100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary Randomness in prompts

Rating
-
Sold
-
Pages
1
Uploaded on
25-07-2023
Written in
2022/2023

Prompt engineering Randomness

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Course

Document information

Summarized whole book?
No
Which chapters are summarized?
Chapter i
Uploaded on
July 25, 2023
Number of pages
1
Written in
2022/2023
Type
Summary

Subjects

Content preview

Prompt engineering-Randomness



Randomness in outputs refers to the generation of unpredictable or diverse responses from a
language model when given the same prompt multiple times. Prompt engineering involves
designing and utilizing prompts to guide the language model's behavior and produce desired
outputs.

To achieve randomness in outputs, you can introduce randomness in various ways during
prompt engineering:

Temperature: Language models like GPT-3.5 use a parameter called "temperature" to control
the randomness of their output. A higher temperature (e.g., 0.8 or 1.0) leads to more diverse and
creative responses, while a lower temperature (e.g., 0.2 or 0.5) produces more focused and
deterministic outputs.

Random Sampling: Instead of selecting the most likely word at each step of generation, you can
randomly sample words from the model's distribution of possible words. This technique
introduces a degree of randomness into the output.

Nucleus (Top-p) Sampling: This is a variant of random sampling where you sample from the
smallest possible set of words that make up a certain cumulative probability (e.g., 90% of the
probability mass). This approach helps maintain the overall coherence of the response while
still allowing for diverse outputs.

Prompts with Diverse Endings: Crafting prompts that have multiple possible ways to conclude
or resolve a task can encourage the model to generate varied responses.

Random Seed: You can introduce randomness by using a random seed value that affects the
model's internal processes, such as selecting different initial states or generating random noise
during sampling.

Reinforcement Learning: Employing reinforcement learning techniques can encourage the
model to explore different outputs and reward it for generating diverse and desirable responses.

It's essential to strike a balance between randomness and coherence when using these
techniques. Too much randomness might lead to incoherent outputs, while too little could result
in the model being too deterministic and repetitive.

Ultimately, the goal of using randomness in prompt engineering is to enhance the creativity and
diversity of the language model's responses while still ensuring they remain relevant and useful
for the given task or application.
$7.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
ramakrishnatammineedi

Get to know the seller

Seller avatar
ramakrishnatammineedi Published
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
5
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions