A 30-Example Model Outperforms the 180B One
I've been following the recent surge in interest in optimizing LLMs for in-context learning, and the increasing concern about token budgets. One paper that caught my eye is "The ROI of Small Examples: Optimizing In-Context Learning Under Token Budgets" from arXiv. The authors propose a new approach to optimizing LLMs for in-context learning, focusing on the trade-off between model performance and token budget.
The authors start by noting that most LLMs are optimized for large datasets and long input sequences. However, in many real-world applications, we have limited token budgets and need to optimize our models for smaller input sequences. They propose a new approach, which they call "small-example optimization," that focuses on optimizing the model for small input sequences.
To evaluate their approach, the authors use a 30-example model, which is significantly smaller than the 180B models that have been dominating the LLM landscape. However, to my surprise, the 30-example model outperforms the 180B one on several tasks. In fact, on the task of in-context learning, the 30-example model achieves a 94.2% accuracy, while the 180B model only achieves a 92.5% accuracy.
But what's even more interesting is that the 30-example model achieves this performance at a significantly lower token budget. According to the authors, the 30-example model requires only 30 tokens to achieve the same performance as the 180B model, which requires over 100 tokens.
pythonimport torch import transformers # Load the 30-example model model = transformers.AutoModelForSequenceClassification.from_pretrained('30-example-model') # Load the 180B model model_180b = transformers.AutoModelForSequenceClassification.from_pretrained('180B-model')
So, what does this mean for us? It means that we may not need to rely on large models and large token budgets to achieve good performance. Instead, we can focus on optimizing smaller models for smaller input sequences. This approach has several advantages, including faster training times and lower computational costs.
However, it's worth noting that the 30-example model is not without its limitations. For example, it may not be as accurate as the 180B model on certain tasks. Nevertheless, the results are promising, and I think it's worth exploring this approach further.
bashpip install transformers pip install torch
Try this
- Run the following command to load the 30-example model:
python -c "import transformers; model = transformers.AutoModelForSequenceClassification.from_pretrained('30-example-model')" - Compare the performance of the 30-example model and the 180B model on the task of in-context learning.
