MachineLearningLM: Continued Pretraining Language Models on Millions of Synthetic Tabular Prediction Tasks Scales In-Context ML
Abstract
MachineLearningLM enhances a general-purpose LLM with robust in-context machine learning capabilities through continued pretraining with synthesized ML tasks, achieving high performance across various domains without task-specific training.
Large language models (LLMs) possess broad world knowledge and strong general-purpose reasoning ability, yet they struggle to learn from many in-context examples on standard machine learning (ML) tasks, that is, to leverage many-shot demonstrations purely via in-context learning (ICL) without gradient descent. We introduce MachineLearningLM, a portable continued-pretraining framework that equips a general-purpose LLM with robust in-context ML capability while preserving its general knowledge and reasoning for broader chat workflows. Our pretraining procedure synthesizes ML tasks from millions of structural causal models (SCMs), spanning shot counts up to 1,024. We begin with a random-forest teacher, distilling tree-based decision strategies into the LLM to strengthen robustness in numerical modeling. All tasks are serialized with a token-efficient prompt, enabling 3x to 6x more examples per context window and delivering up to 50x amortized throughput via batch inference. Despite a modest setup (Qwen-2.5-7B-Instruct with LoRA rank 8), MachineLearningLM outperforms strong LLM baselines (e.g., GPT-5-mini) by an average of about 15% on out-of-distribution tabular classification across finance, physics, biology, and healthcare domains. It exhibits a striking many-shot scaling law: accuracy increases monotonically as in-context demonstrations grow from 8 to 1,024. Without any task-specific training, it attains random-forest-level accuracy across hundreds of shots. General chat capabilities, including knowledge and reasoning, are preserved: it achieves 75.4% on MMLU.
Community
MachineLearningML: Scaling Many-shot In-context Learning via Continued Pretraining
Meet MachineLearningLM —continued pretraining on millions of synthetic tasks → robust many-shot ICL.📈 Scales 8→1024 shots; +15% accuracy vs strong LLMs; 🌲 Random-Forest–level numerical modeling; 🧠 Genral knowledge and reasoning (MMLU 75.4%).
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- MSGCoOp: Multiple Semantic-Guided Context Optimization for Few-Shot Learning (2025)
- Supervised In-Context Fine-Tuning for Generative Sequence Labeling (2025)
- Memory Decoder: A Pretrained, Plug-and-Play Memory for Large Language Models (2025)
- Distilled Pretraining: A modern lens of Data, In-Context Learning and Test-Time Scaling (2025)
- Towards Universal Neural Inference (2025)
- Text-Trained LLMs Can Zero-Shot Extrapolate PDE Dynamics (2025)
- True Multimodal In-Context Learning Needs Attention to the Visual Context (2025)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment:
@librarian-bot
recommend
Models citing this paper 1
Datasets citing this paper 1
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper