Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
18 votes
Accepted

Why does prompt engineering work, since prompt engineering questions don't appear as training data?

LLMs are usually fine-tuned on instruction-following datasets so that they can answer user requests. For instance, ChatGPT comes from InstructGPT, which was trained from GPT-3 with reinforcement ...
noe's user avatar
  • 26.9k
9 votes

Why does prompt engineering work, since prompt engineering questions don't appear as training data?

I believe you misunderstand how LLMs work. They are not search engines that look through a data set trying to find a best match. An LLM essentially (very simplified, and I'm not an expert) generates ...
Tom's user avatar
  • 191
5 votes
Accepted

Should you care about truncation and padding in an LLM even if it has a very large tokenizer.max_length so that truncation will never happen?

The large number you are seeing is not the maximum length, but the maximum representable integer at that precision. It's there because no maximum length has been set. The original GPT-2 has a maximum ...
noe's user avatar
  • 26.9k
5 votes
Accepted

LLMs for text generation

Yes, there are open multimodal LLMs that you can fine-tune yourself, like LlaVa, NextGPT, IDEFICS or SPHINX. Closed multimodal LLMs like GPT-4v don't offer a way to fine-tune them yet.
noe's user avatar
  • 26.9k
4 votes
Accepted

Higher level sentence similarity (meaning instead of 'just' embeddings)

The similarity used to train this model might be different from the similarity you expect. A better approach would be create your own large and good quality training set of similar and dissimilar ...
Valentas's user avatar
  • 1,209
4 votes

Why does prompt engineering work, since prompt engineering questions don't appear as training data?

There are 3 layers to the answer why: ChatGPT is fine tuned with around 11,000 examples of humans asking questions, and receiving helpful and intelligent responses. On the surface, LLMs have only one ...
Danny Cisco's user avatar
4 votes
Accepted

Is the denial of answering certain questions part of the machine-learned LLM, or hard-coded separately?

The efforts to add "guardrails" to LLMs is usually referred to as LLM alignment. While the internals of ChatGPT are not known, usually LLM alignment is done at the model level via training/...
noe's user avatar
  • 26.9k
4 votes
Accepted

How do I prompt GPT-4 to look at a PDF in Jupyter Notebook?

OpenAI's API does not support providing PDFs. Therefore, what you intend to do is not possible. You have other options though: Parse the PDF locally and send text to GPT4. The parse may consist of ...
noe's user avatar
  • 26.9k
3 votes

Why does prompt engineering work, since prompt engineering questions don't appear as training data?

assume an LLM is trained only on stackoverflow questions and answers. I think that it is where you are getting things wrong. LMM are trained on pile of texts (one such dataset is even known as "...
Lucas Morin's user avatar
  • 2,234
3 votes

Is there a Language Model that can accept huge corpse of tabular data and answr questions about?

Language models will experience difficulties processing in an analytical way tabular data and answering complex questions about it because of how they work (just predicting the next token). Maybe you ...
Giovanni Amorim's user avatar
3 votes
Accepted

How to download and fine tune a large language model locally?

Can I do it on a regular PC (I understand it may run for several hours)? As a general guideline, you need a powerful workstation to perform this task. You should certainly consider having a cuda/gpu ...
J. Doe's user avatar
  • 56
3 votes

Understanding alpha parameter tuning in LORA paper

I had the same question. I still haven't got a convincing answer, but while searching I found these that might be helpful: In this blog, they say: Alpha scales the learned weights. Existing ...
Helena Maxcici's user avatar
3 votes

Why does prompt engineering work, since prompt engineering questions don't appear as training data?

I think this article is one of the best I've seen which describes LLMs in an accessible way without dumbing it down to the point where it's unhelpful: "Large language models, explained with a ...
JimmyJames's user avatar
3 votes

Why does prompt engineering work, since prompt engineering questions don't appear as training data?

The short answer: engineered prompts are deliberately similar to fragments from training data, and this similarity is sufficient to elicit desired responses. Prompts do not need to literally appear in ...
Corbin's user avatar
  • 131
2 votes
Accepted

How to measure accuracy of GPT model

You can check the Question Generation section of paperswithcode. There, you can see for different datasets how the performance is measured and how different proposed approaches compare on them. ...
noe's user avatar
  • 26.9k
2 votes
Accepted

Can I run falcon-7b on a free google colab?

Yes there are a couple things you can do to fit the model into google colab's disk. Reduce the batch size for train and test. This will reduce the GPU memory used for each epoch. Default size set in ...
spectre's user avatar
  • 2,105
2 votes

Open-Source Large Language Models (LLM): Your experience and recommendation

You should check the Open LLM Leaderboard from Huggingface. They maintain a ranking of open LLMs in different tasks. The ones finetuned to follow instructions are marked. When clicking on each model, ...
noe's user avatar
  • 26.9k
2 votes

Do we really need a very large dataset to train GPTs?

Train from scratch If you want to train a LLM from scratch, then its a different ball game. In this case, yes you need a lot of data for training purposes. This is because when you fine tune a model (...
spectre's user avatar
  • 2,105
2 votes

How can you get a Huggingface fine-tuning model with the Trainer class from your own text where you can set the arguments for truncation and padding?

If you use transformers example scripts, for example, summarization, you can control padding and truncation with command line arguments --pad_to_max_length, ...
Valentas's user avatar
  • 1,209
2 votes
Accepted

Implementation of spBLEU

spBLEU was introduced in the Flores-101 article: [...] we propose to use BLEU over text tokenized with a single language-agnostic and publicly available fixed SentencePiece subword model. We call ...
noe's user avatar
  • 26.9k
2 votes
Accepted

Falcon-7B llm giving random output

You are using the GPT-2 tokenizer instead of the model's own tokenizer. Try getting the tokenizer from the model instead: ...
noe's user avatar
  • 26.9k
2 votes
Accepted

How to check the license of a LLM for specific use?

LLMs are usually uploaded by their creator company to Huggingface, and they specify the license. For instance, Mixtral has Apache License 2.0, while Llama2 has a custom license. You should read the ...
noe's user avatar
  • 26.9k
2 votes
Accepted

How to combine two vector embeddings into one?

How do you plan on using these embeddings? You can definitely use concatenated embeddings for similarity/retrieval, but only when comparing concat embeddings to other concat embeddings. Your point ...
Karl's user avatar
  • 746
2 votes
Accepted

Prompt Ops Alternatives

We use Langfuse to manage 100% of our prompts + us them for observability, evals, too. Excellent product & the team is very responsive to requests and it's open source if you care about that: ...
Jordie's user avatar
  • 36
1 vote

Could You Suggest Me Some Details of Realizing This LLM?

Upon thinking it over, I came to a conclusion that maybe the dates can be omitted altogether; it's a strict chronological order of (the descriptions of) the events that will do the trick. I base this ...
avpol's user avatar
  • 21
1 vote

Does Google DeepMind's Gemma 7B models specs have inconsistent dimensions?

From the annotated transformer link - https://nlp.seas.harvard.edu/annotated-transformer/#full-model For the positionwiseFeedForward network: D_model = 512, and the inner layer has dimensionality dff ...
brewmaster321's user avatar
1 vote
Accepted

How can I get the list of pretrained large language models?

Here are some useful resources:- i. Hugging Face ii. Awesome-LLM: a curated list of Large Language Model iii. A list of open LLMs available for commercial use. iv. A curated list for Efficient Large ...
pparker's user avatar
  • 392
1 vote

How to choose ideal pretrained model for fine-tuning?

There are too many! Some examples: Intended use of the model regarding its compatibility with the licenses of available model (p.ej. is commercial use allowed?). intended use of the model to know if ...
noe's user avatar
  • 26.9k
1 vote
Accepted

Train Reward Model using Llama2:

Problem is solved. The issue is max_length. when lower value used to max_length this issue is not occurs. that means 30GB gpu not enogh to for this process.
Sandun Tharaka's user avatar
1 vote
Accepted

Outdated Transformers TextDataset class drops last block when text overlaps. Replace by datasets Dataset class as input of Trainer train_dataset?

You need to from datasets import load_dataset, and even though the warning tells you so, you do not seem to need to import the Dataset class if you just want to run ...
questionto42's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible