# Generation Parameters in Skyone Studio

### Introduction

Large Language Models (LLMs) are artificial intelligence systems capable of understanding and generating text in a way that resembles human communication. They are trained on billions of words and language examples to predict the next word in a sentence.

In Skyone Studio, LLMs can be fine-tuned through configuration parameters. These parameters act like control levers: they allow the user to decide whether they want shorter or longer answers, more creative or more precise, more varied or more objective.

This document explains in detail the main text generation parameters available, helping both technical professionals and business users understand and use the tool more effectively.

***

### Key Terms (Glossary)

* **LLM (Large Language Model)**: A large-scale language model trained to understand and generate text.
* **Token**: The minimum unit of text used by the model (it can be a whole word, part of a word, or even a symbol).
* **Prompt**: The text or instruction provided by the user for the model to generate a response.
* **Max\_tokens**: The maximum number of tokens the model can generate in an output.
* **Temperature**: A parameter that controls the level of creativity/randomness in the text.
* **Top\_p (Nucleus Sampling)**: Defines the percentage of the most probable tokens to be considered.
* **Top\_k**: Limits the number of possible tokens at each generation step.
* **Presence\_penalty**: Penalizes repetitions and encourages variety in the text.
* **Stop**: Defines words or symbols that interrupt text generation.

***

### Generation Parameters

#### Max\_tokens

Description: Sets the maximum number of tokens the model can generate.\
Practical Example:

* max\_tokens = 15 → short answer.
* max\_tokens = 100 → long and detailed answer.\
  Analogy: It’s like choosing the size of the sheet of paper the model can write on.

<figure><img src="https://2493694111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQPcfIOA6Tl2Bmk6CdV2O%2Fuploads%2Fx1FNndPUj7xOjRVI0gvj%2Fmax_token_ingl%C3%AAs-removebg-preview.png?alt=media&#x26;token=5b042a03-b0e8-4730-b6a0-a4890bbe836a" alt=""><figcaption></figcaption></figure>

***

#### Temperature

**Description**: Controls the creativity and randomness of the response.

* Low temperature → Objective and predictable answers.
* High temperature → Creative and varied answers.

Analogy: It’s like the “temperature” of a conversation: cold (direct) or warm (diverse and full of ideas).\


<figure><img src="https://2493694111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQPcfIOA6Tl2Bmk6CdV2O%2Fuploads%2Fy6wi6bztoijrhxFqlLDK%2FTemperature_ingl%C3%AAs-removebg-preview.png?alt=media&#x26;token=ecc4d1cb-069e-4ce7-8709-4cd7b45713c0" alt=""><figcaption></figcaption></figure>

***

#### Top\_p

**Description**: Defines the cumulative percentage of the most probable tokens to be considered.\
Example:

* top\_p = 0.1 → only the top 10% most likely tokens.
* top\_p = 0.9 → includes less common words.\
  Analogy: It’s like using a sieve: the finer it is, the fewer options get through.\


<figure><img src="https://2493694111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQPcfIOA6Tl2Bmk6CdV2O%2Fuploads%2FkQDJg0RsLM3BrI8QaD7T%2Ftop_p_ingl%C3%AAs-removebg-preview.png?alt=media&#x26;token=6fde4ecc-4c52-4404-bb94-4f2c3e12a100" alt=""><figcaption></figcaption></figure>

***

#### Top\_k

**Description**: Restricts generation to the top k most likely tokens.\
Example:

* top\_k = 2 → very restricted choices.
* top\_k = 40 → broader choices.\
  Analogy: It’s like a menu: it can be small (few options) or large (more variety).\


<figure><img src="https://2493694111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQPcfIOA6Tl2Bmk6CdV2O%2Fuploads%2FFpsQaINJsjvHR0Dow8Mx%2Ftop_k_ingl%C3%AAs-removebg-preview.png?alt=media&#x26;token=0e216d5b-b550-4dc1-9325-1252175d1971" alt=""><figcaption></figcaption></figure>

***

#### Presence\_penalty

**Description**: Penalizes repetitions and encourages the model to explore new words and ideas.\
Example:

* Without penalty: “He likes to run, run, and run...”
* With penalty: “He likes to run, play sports, and stay active.”\
  Analogy: It’s like asking someone not to repeat the same story over and over in a conversation.\


<figure><img src="https://2493694111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQPcfIOA6Tl2Bmk6CdV2O%2Fuploads%2FrfmsGkfWjglfgIJz2BtX%2Fpresence_penalty_ingl%C3%AAs-removebg-preview.png?alt=media&#x26;token=8b54b47a-40db-421e-b06e-0f0e390f4f48" alt=""><figcaption></figcaption></figure>

***

#### Stop

**Description**: A list of words or symbols that determine where the model should stop.\
Example:

*   stop = \["end"] → the response stops immediately after this word.\
    Analogy: It’s like pressing the “pause” button at the right moment.\
    \


    <figure><img src="https://2493694111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQPcfIOA6Tl2Bmk6CdV2O%2Fuploads%2FHKVZiGA7vEGMfqwXcD3u%2Fstop%20ingleeess.png?alt=media&#x26;token=4503ec01-3494-401c-b67c-31bdf5541b3f" alt=""><figcaption></figcaption></figure>

***

### Best Practices

* Adjust max\_tokens according to the expected response length.
* Use low temperature for technical answers and high for creative tasks.
* Combine top\_p and top\_k to balance diversity and predictability.
* Apply presence\_penalty to avoid redundancy.
* Use stop to ensure the output ends at the desired point.
* Always log the parameters used to reproduce results in the future.\


<figure><img src="https://2493694111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQPcfIOA6Tl2Bmk6CdV2O%2Fuploads%2FtxHDsabNVudrkAMqUMjA%2Fboas_praticas_ingles-removebg-preview.png?alt=media&#x26;token=9cc9dd45-2ceb-4a1b-9775-a85cf57861cf" alt=""><figcaption></figcaption></figure>

***

### FAQ

<details>

<summary>What is a token?</summary>

A token is a piece of text, which can be a whole word, part of a word, or even a symbol.

</details>

<details>

<summary>What’s the difference between Top_p and Top_k?</summary>

* Top\_k sets a fixed number of possible words.

- Top\_p uses a cumulative probability percentage.

</details>

<details>

<summary>When should I use a high temperature?</summary>

For creative tasks such as brainstorming, story generation, or free drafting.

</details>

<details>

<summary>Can the presence_penalty cause problems?</summary>

Yes. If set too high, it can hurt coherence by forcing excessive variety.

</details>

<details>

<summary>Do I always need to define all parameters?</summary>

No. Many have default values that work well in most cases, but manually tuning them helps achieve more precise results.

</details>

\
