Large language model

최근글


새댓글


Hot Deal


Gen AI 분류

The `top_p` parameter (range: 0.0 - 1.0, default 0.95)

컨텐츠 정보

본문

#### The `top_p` parameter (range: 0.0 - 1.0, default 0.95) ##### What is _top_p_? `top_p` controls how the model selects tokens for output by adjusting the probability distribution of the next word in the generated text based on a cumulative probability cutoff. Specifically, it selects the smallest set of tokens whose cumulative probability exceeds the given cutoff probability _p_, and samples from this set uniformly. For example, suppose tokens A, B, and C have a probability of 0.3, 0.2, and 0.1, and the `top_p` value is 0.5. In that case, the model will select either A or B as the next token (using temperature) and not consider C, because the cumulative probability of top_p is <= 0.5. Specify a lower value for less random responses and a higher value for more random responses. ##### How does _top_p_ affect the response? The `top_p` parameter is used to control the diversity of the generated text. A higher `top_p` parameter value results in more "diverse" and "interesting" outputs, with the model being allowed to sample from a larger pool of possibilities. In contrast, a lower `top_p` parameter value resulted in more predictable outputs, with the model being constrained to a smaller set of possible tokens. ##### Example: `top_p = 0.1`: - The cat sat on the mat. - The cat sat on the floor. `top_p = 0.9`: - The cat sat on the windowsill, soaking up the sun's rays. - The cat sat on the edge of the bed, watching the birds outside. For more information on the `top_p` parameter for text models, please refer to the [documentation on model parameters](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models#text_model_parameters).

관련자료

댓글 1

Goormit님의 댓글

#### 'top_p' 매개 변수(범위: 0.0 - 1.0, 기본값 0.95)

##### _top_p_가 무엇입니까?
'top_p'는 누적 확률 컷오프를 기준으로 생성된 텍스트에서 다음 단어의 확률 분포를 조정하여 모델이 출력할 토큰을 선택하는 방법을 제어합니다. 구체적으로, 누적 확률이 주어진 컷오프 확률 _p_를 초과하는 가장 작은 토큰 집합을 선택하고, 이 집합에서 샘플을 균일하게 선택합니다.


예를 들어 토큰 A, B, C의 확률이 0.3, 0.2, 0.1이고 'top_p' 값이 0.5라고 가정합니다. 그 경우 모델은 (온도를 사용하여) 다음 토큰으로 A 또는 B 중 하나를 선택하고 C를 고려하지 않습니다. top_p의 누적 확률은 <= 0.5이기 때문에 덜 무작위한 응답의 경우 더 낮은 값을 지정하고 더 무작위한 응답의 경우 더 높은 값을 지정합니다.

##### _top_p_가 응답에 어떤 영향을 미칩니까?

top_p' 매개변수는 생성된 텍스트의 다양성을 조절하는 데 사용됩니다. top_p' 매개변수 값이 높을수록 더 많은 "다양한" 그리고 "흥미로운" 출력이 생성되며, 모델은 더 큰 가능성 풀에서 샘플링 할 수 있습니다. 반면에 'top_p' 매개변수 값이 낮으면 모델은 더 작은 가능한 토큰 세트로 제한되어 더 예측 가능한 출력이 생성됩니다.


##### 예:

''top_p = 0.1'':

- 고양이는 매트 위에 앉았습니다.
- 고양이는 바닥에 앉았습니다.

''top_p = 0.9'':

- 고양이는 창턱에 앉아 햇빛을 쬐고 있었습니다.
- 고양이는 침대 가장자리에 앉아서 밖에서 새들을 지켜봤습니다.

텍스트 모델의 'top_p' 파라미터에 대한 자세한 내용은 [모델 파라미터에 대한 document](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models#text_model_parameters) 를 참조하시기 바랍니다.
전체 12 / 1 페이지
RSS
번호
제목
이름