When Do Language Models Need to Be Large?

Zhixun Chen, Yali Du, David Henry MguniFM-Wild @ ICML 2024

TL;DR

This paper introduces LONDI, a novel framework that intelligently switches between a small, efficient language model (LM) and a large, powerful language model (LLM) to balance performance and computational cost. LONDI learns to use the LLM only when complex reasoning is truly necessary, significantly reducing resource usage while maintaining the ability to solve challenging tasks.

What Problem Does This Paper Address?

Large Language Models (LLMs) have become incredibly powerful, but their massive computational demands for training and execution pose a significant hurdle for deployment, especially on resource-constrained edge devices like smartphones or IoT devices. This high cost limits their accessibility and widespread adoption. While smaller LMs are more efficient, they often lack the capability to handle complex reasoning tasks. The challenge, therefore, is to leverage the power of LLMs without incurring prohibitive computational costs.

Methods

The core of LONDI is a dual-language model system that mimics human dual-process thinking (fast, intuitive vs. slow, reflective). It comprises:

  • QUICK Model: A smaller, computationally inexpensive LM that handles most tasks.
  • DEEPTHINK Model: A larger, more powerful LLM used for complex reasoning.
  • Switcher (RL Agent): A reinforcement learning agent that learns a policy to decide when to activate the DEEPTHINK model and when to rely on the QUICK model. This decision is based on the current state of the environment.

LONDI introduces a "switching cost" parameter (c) that penalizes the use of DEEPTHINK, encouraging the Switcher to be selective. A variant, LONDI-B, further refines this by imposing a strict budget on the number of DEEPTHINK calls, ensuring predictable resource usage. The Switcher is trained using a reinforcement learning approach, specifically employing switching controls, to learn the optimal strategy for activating DEEPTHINK.

Datasets

The paper evaluates LONDI on two existing benchmarks:

  • ScienceWorld: A simulated residential setting with diverse objects and tasks requiring navigation and interaction.
  • BabyAI-Text: A 2D grid-based simulation environment focused on tasks involving object manipulation and navigation.

No new benchmarks were introduced.

Key Insights and Ideas

  • Dual-Process Inspiration: The paper effectively draws an analogy to human cognitive processes, suggesting that mimicking this "fast and slow" thinking can lead to more efficient AI systems.
  • Intelligent Resource Allocation: The core idea of dynamically allocating computational resources based on task complexity is a powerful concept for making LLMs more practical.
  • Cost as a Learning Signal: Using a cost parameter to guide the RL agent's decision-making is an elegant way to enforce resource constraints and trade-offs.
  • Plug-and-Play Framework: LONDI is designed to be modular, allowing different QUICK and DEEPTHINK models to be swapped in, making it adaptable to various LLM architectures.

Key Results

  • Significant GPU Usage Reduction: LONDI demonstrated up to a 30% reduction in GPU usage compared to using only the large LLM (DEEPTHINK) while still solving tasks that were otherwise unsolvable by the smaller LM (QUICK).
  • Performance Trade-offs: The cost parameter (c) effectively calibrated the performance-resource trade-off. Higher costs led to more conservative DEEPTHINK usage and lower rewards, while lower costs allowed for more DEEPTHINK activations and higher rewards.
  • LONDI-B Effectiveness: The budget-constrained variant (LONDI-B) achieved performance close to DEEPTHINK-only (e.g., 90% performance with 60% fewer DEEPTHINK calls) and outperformed other baselines like SWIFTSAGE and FrugalGPT.
  • Adaptability: LONDI showed robustness by achieving similar performance even when the QUICK module was a random agent or a less proficient model, by simply activating DEEPTHINK more frequently.

Limitations and Future Work

  • Sample Efficiency: The paper acknowledges that the model-free switcher requires a large amount of training data, which might be a limitation in resource-constrained environments. Future work could explore model-based algorithms to improve sample efficiency.
  • Generalizability: LONDI, like many RL agents, requires training for new environments. Direct generalization to unseen environments without retraining is not discussed. Future work could investigate combining reinforcement learning with causal inference to enhance generalizability.
  • Model-Free Nature: The reliance on a model-free switcher might limit its applicability in highly dynamic or safety-critical scenarios where explicit model knowledge is preferred.

Summary updated

BibTeX
@inproceedings{chen2024when,
  author = {Zhixun Chen and Yali Du and David Henry Mguni},
  title = {{When Do Language Models Need to Be Large?}},
  booktitle = {FM-Wild @ ICML},
  year = {2024},
  url = {https://openreview.net/forum?id=z7lXuhciCD},
}
Figure