You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/genai/04_how_to_guides/01_temperature.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Temperature
1
+
# Effect of Temperature
2
2
3
3
Generating text (or images) from LLMs is inherently probabilistic. However, as an end user you have many parameters at your disposal to tweak the behavior of LLMs. Of these, temperature is the most commonly used. Broadly, it controls the randomness of the generated text. A lower temperature produces more deterministic outputs, while a higher temperature produces more random "creative" output. For a more comprehensive explanation on this topic, refer to the following:
4
4
-[How to generate text: using different decoding methods for language generation with Transformers](https://huggingface.co/blog/how-to-generate)
While Decoder-only LLMs gained massive popularity via their usage in chatbots, Encoder-only LLMs can be used for a wider variety of tasks. Decoder-only LLMs "generate" tokens ("text") one at a time probabalisticsally. Encoder-only LLMs on the other hand take text as their input, tokenize it and generate "embeddings" as their output. Here, we shall walk through a task of generating embeddings from a text snippet.
4
+
5
+
```mermaid
6
+
flowchart LR;
7
+
A["natual language text: <br> *GenAI can be used for research*"]
Large Language Models only know about the data they were trained upon and do not have the context needed to be effective at answering questions based on:
4
+
- private datasets
5
+
- newer knowledge past the cutoff date (i.e. the date at which data collection was frozen)
6
+
7
+
To get around this issue, one of the most popular techniques is Retrieval-augmented generation, the most basic version of which is outlined below:
8
+
9
+
```mermaid
10
+
flowchart TB;
11
+
A["Documents to use in RAG pipeline"]
12
+
B@{shape: docs, label: "Document parsed and divided into multiple chunks"}
13
+
C["encoder-only LLM"]
14
+
D@{shape: procs, label: "text chunk embedding"}
15
+
E[("vector database")]
16
+
F["natual language prompt"]
17
+
G["query embedding"]
18
+
I["relevant chunks"]
19
+
J["original prompt with added context"]
20
+
K["relevant response from LLM using context"]
21
+
subgraph Ingestion
22
+
A-- "Parse and Chunk" -->B;
23
+
end
24
+
subgraph Embeddings
25
+
B-- "Pass to embedding model" -->C;
26
+
C-- "Generate Embeddings" -->D;
27
+
D-- "Store Emebddings" -->E;
28
+
end
29
+
subgraph Retrieval
30
+
F-- "Pass to embedding model" -->C;
31
+
C-- "Generate Emebddings" -->G;
32
+
G-- "Query vector database" -->E;
33
+
E-- "Gather text chunks with embeddings similar to prompt" -->I;
34
+
end
35
+
I-- "With expanded prompt" -->J;
36
+
subgraph Augmented Generation
37
+
J-- "LLM" -->K;
38
+
end
39
+
```
40
+
41
+
It starts with the "Ingestion" phase where a document to be used as context is parsed and broken into chunks. These chunks are then converted to embeddings and stored in a vector database (which specializes in storing and retrieving vectors). This setup allows us now "retrieve" the required context for an incoming prompt before it is sent to an LLM. The "retrieval" phase consists of converting the prompt to an embedding and looking up embeddings for chunks of the document that are similar to it. The text chunks associated with the embeddings similar to the embedding for the query are then added as additional context to the prompt before passing it to an LLM.
42
+
The LLM now has the associated context it needs to generate an relevant response to the prompt. Here's a link to a script to test this out yourself, once you have API access to an embedding model and an LLM: https://github.com/NYU-RTS/rts-docs-examples/tree/main/genai/rag .
43
+
44
+
You can run it to ask a question about a recent event that occurred after the knowledge cutoff for the dataset used to train the LLM:
45
+
```sh
46
+
ss19980@ITS-JQKQGQQMTX ~/D/p/r/g/rag (main)> uv run rag_basic.py \
('The 2025 London Marathon was the 45th running of the London Marathon; it took place on 27 April 2025.[1][2]', 0.8441829085350037)
57
+
('1. ^ Martin, Andy (26 April 2025). "London Marathon 2025: route, runners and everything else you need to know". The Guardian. Retrieved 26 April 2025.\n2. ^ Poole, Harry (26 April 2025). "Will \'greatest\' London Marathon line-ups break records?". BBC News. Retrieved 26 April 2025.\n3. ^ a b c d "2025 London Marathon results". NBC Sports. 27 April 2025. Retrieved 27 April 2025.', 0.837587296962738)
58
+
('Venue, 45th London Marathon = London, England. Date, 45th London Marathon = 27 April 2025. Champions, 45th London Marathon = Champions. Men, 45th London Marathon = Sabastian Sawe (2:02:27). Women, 45th London Marathon = Tigst Assefa (2:15:50). Wheelchair men, 45th London Marathon = Marcel Hug (1:25:25). Wheelchair women, 45th London Marathon = Catherine Debrunner (1:34:18). ←\xa020242026\xa0→, 45th London Marathon = ←\xa020242026\xa0→', 0.8032743334770203)
@@ -25,11 +28,11 @@ NYU HPC clusters and related resources are available to full-time NYU faculty an
25
28
26
29
## Getting a new account on the NYU HPC clusters
27
30
28
-
To request an NYU HPC account please log in to [NYU Identity Management service][nyu ims link] and follow the link to "Request HPC account". We have a walkthrough of how to \[request an account through IIQ]. If you are a student, alumni or an external collaborator you need an NYU faculty sponsor.
31
+
To request an NYU HPC account please log in to [NYU Identity Management service][nyu ims link] and follow the link to "Request HPC account". We have a walkthrough of how to [request an account through IIQ](03_walkthrough_request_hpc_account.mdx). If you are a student, alumni or an external collaborator you need an NYU faculty sponsor.
29
32
30
33
## Renewing HPC account
31
34
32
-
Each year, non-faculty users must renew their HPC account by filling in the account renewal form from the [NYU Identity Management service][nyu ims link]. See [Renewing your HPC account with IIQ](./03_walkthrough_approve_hpc_account_request.md) for a walkthrough of the process.
35
+
Each year, non-faculty users must renew their HPC account by filling in the account renewal form from the [NYU Identity Management service][nyu ims link]. See [Renewing your HPC account](05_walkthrough_renew_hpc_account.md) for a walkthrough of the process.
33
36
34
37
## Information for faculty who sponsor HPC users
35
38
@@ -61,13 +64,13 @@ HPC faculty sponsors are expected to:
61
64
62
65
- Respond promptly to account-related requests from HPC staff
63
66
64
-
Each year, your sponsored users must renew their account. You will need to approve the renewal by logging into the [NYU Identity Management service][nyu ims link]. We have a [walkthrogh of the approval process here](./03_walkthrough_approve_hpc_account_request.md)
67
+
Each year, your sponsored users must renew their account. You will need to approve the renewal by logging into the [NYU Identity Management service][nyu ims link]. We have a [walkthrogh of the approval process here](04_walkthrough_approve_hpc_account_request.md)
65
68
66
69
## Bulk HPC Accounts for Courses
67
70
68
71
HPC bulk accounts request is disabled for HPC sponsors.
69
72
70
-
- If you would like to use JupyterHub for your classes, please don't submit the form below, read \[Jupyter Hub page] instead (the link to an intake form is also there)
73
+
- If you would like to use JupyterHub for your classes, please don't submit the form below, read \[Jupyter Hub page]**TODO Add a page for JHub in the Cloud section** instead (the link to an intake form is also there)
71
74
72
75
- Please fill out this [request form][hpc account request form link for courses] for the course, we'll create HPC accounts for the class per request
73
76
@@ -81,7 +84,7 @@ NYU partners (\[look for the list here]) with many state and national facilities
81
84
82
85
If you are part of collaboration with NYU researcher you need to obtain an **affiliate** status before applying for an NYU HPC account. A full-time NYU faculty member must sponsor a non-NYU collaborator for an affiliate status.
83
86
84
-
Please see [instructions for affiliate management][affiliate and account management link] (NYU NetID login is required to follow the link). [Please read instructions about sponsoring external collaborators here](./05_hpc_accounts_external_collaborators.md).
87
+
Please see [instructions for affiliate management][affiliate and account management link] (NYU NetID login is required to follow the link). [Please read instructions about sponsoring external collaborators here](06_hpc_accounts_external_collaborators.md).
85
88
86
89
87
90
## Access to cluster after Graduation
@@ -97,13 +100,25 @@ If you are not part of a collaboration, your access to cluster will end together
97
100
98
101
In order to request a new HPC account or renew an expired one, you need to be connected to the NYU VPN if you are working remotely, Please see [instructions on how to install and use the NYU VPN][nyu vpn link]. Linux clients are not officially supported, however we were able to successfully use openVPN client. Here are installation and connection instructions for a debian linux distribution with apt package manager:
99
102
100
-
```sh
101
-
apt-get install openconnect
102
-
sudo openconnect -b vpn.nyu.edu
103
-
```
104
103
105
-
_When prompted follow the instructions and provide your netID, password, and authenticate with ('push', 'phone1' or 'sms')_
0 commit comments