๐ฏ Introducing Chayan: A Calibrated 4-Model LLM Router Achieving 69% Accuracy on RouterArena
We're excited to share Chayan, a cost-efficient LLM router that intelligently routes queries between 4 models to maximize accuracy while minimizing cost. Chayan just submitted to the RouterArena leaderboard and achieved 69.05% accuracy on the benchmark!
Chayan achieves impressive results on the RouterArena benchmark: โข 69.05% accuracy (would rank #1 on current leaderboard) โข $0.333 per 1K queries โข +12.07pp improvement over all-mini baseline (56.98%) โข 99% of perfect 2-model oracle performance at 57% lower cost
Compared to our previous 2-model router (61.43% accuracy), Chayan delivers +7.62pp improvement through smarter 4-model routing.
๐ง How It Works
Chayan uses an Adaptive K-NN classifier with prototype memory to route between 4 models: โข openai/gpt-4o-mini (fast & cheap) โข google/gemini-2.5-flash-lite (balanced) โข google/gemini-2.5-flash (capable) โข openai/gpt-4o (most powerful)
๐ Getting Started
You can use Chayan directly from HuggingFace:
from adaptive_classifier import AdaptiveClassifier
These samples were created using reservoir sampling - an algorithm that guarantees statistically unbiased random samples from massive source datasets. This means results you get at the 1B token scale are representative of how these datasets behave at 100B+ token scales, letting you iterate quickly without the computational overhead.
The collection includes: - finePDFs-1B: High-quality textbook-style educational content - DCLM-baseline-1B: Filtered, diverse web content - FineWeb-Edu-1B: Curated educational web resources
We used these exact samples to run 50+ systematic experiments on dataset mixing strategies, ultimately discovering that a 50-30-20 mixture of finePDFs + DCLM-baseline + FineWeb-Edu achieves 90%+ of GPT-2's performance with just 1/10th the training data.
Whether you're researching optimal data mixtures, testing curriculum learning strategies, or just want to quickly prototype a pretraining run, these samples give you a solid foundation to start experimenting immediately.
MARS Achieves Strong Results on Google DeepMind's IMO-Bench
We evaluated OptiLLM's MARS (Multi-Agent Reasoning System) approach on IMO-Bench, Google DeepMind's challenging mathematical reasoning benchmark with International Mathematical Olympiad-level problems.
What is MARS?
MARS is a multi-agent reasoning technique that works with any LLM. It uses 3 parallel reasoning agents that independently solve problems, then verifies their solutions through consensus and iterative refinement. The key advantage: it's model-agnostic and can be applied to any base model through OptiLLM's inference proxy.
Results on IMO-Bench:
AnswerBench (400 short-answer problems): MARS: 36.0% (144/400 correct) Baseline: 24.5% (98/400 correct) Improvement: +11.5pp across all domains
All results achieved using google/gemini-2.5-flash-lite-preview-09-2025 as the base model. The same MARS approach can enhance reasoning for any model through OptiLLM's OpenAI-compatible API.
Datasets available at: AnswerBench: huggingface.co/datasets/Hwilner/imo-answerbench ProofBench: huggingface.co/datasets/Hwilner/imo-proofbench
Try it yourself:
python optillm.py --approach mars --model google/gemini-2.5-flash-lite-preview-09-2025
On this day in 2019, OpenAI released the final GPT-2 model as part of their staged release. I still remember that November well - so much was happening, but GPT-2's release felt like a watershed moment for the field. It showed us what was possible with carefully trained language models.
To recreate some of that GPT-2 magic, I recently tackled an interesting challenge: can you pretrain a language model with just 1 billion tokens - roughly 1/10th of what GPT-2 used - and still get comparable performance? After 50+ systematic experiments testing different dataset mixtures, the answer is yes.
The result is codelion/gpt-2-70m, which achieves over 90% of GPT-2's benchmark performance despite being trained on 10x less data. The key was finding the optimal dataset composition: 50% high-quality textbook PDFs, 30% filtered web content, and 20% educational resources. It even beats GPT-2 on TruthfulQA (47.31% vs 40.69%).
The 1 Billion Token Challenge: Finding the Perfect Pre-training Mix
We trained a GPT-2 model to 90%+ performance using just 1/10th the training data through 50+ systematic experiments on dataset mixing strategies.
Key Finding:
A static mix of 50% finePDFs + 30% DCLM-baseline + 20% FineWeb-Edu consistently outperforms complex curriculum learning approaches. Static mixing is simpler, faster, and avoids catastrophic failures from hard distribution shifts.
Results:
Our GPT-2-70M model (70M parameters, 1B tokens) scores 38.15% on benchmarks vs GPT-2's 39.13% - only 0.98 points behind despite 10x less data and 44% fewer parameters. It even beats GPT-2 on TruthfulQA (47.31% vs 40.69%).
The takeaway: careful dataset curation matters more than total data volume.
๐ง Introducing Ellora Recipe #6: Execution-Aware World Model for Qwen3-4B-Thinking
Teaching LLMs to understand not just what code does, but HOW it executes at runtime!
Inspired by Meta's CWM (Code World Model) research, this LoRA adapter adds execution awareness to Qwen3-4B-Thinking-2507. The model learns to predict variable states, trace program execution step-by-step, and debug code by understanding runtime behavior.
๐ Key Innovation: We combine Qwen3's native thinking capabilities with real Python execution traces captured via sys.settrace(). The model is trained using GRPO with a custom reward function that scores execution prediction accuracy.
๐ Training Approach: - Hybrid Magpie-style code generation - Real execution tracing for ground truth - Self-supervised learning (no manual annotations!) - 298 training samples with execution traces
โจ What it does: - Predicts variable states at each line of code - Explains execution flow with thinking tags - Helps debug by understanding runtime behavior - Works as a "neural debugger"
๐ฏ Results: - 20% overall accuracy on execution prediction - 33.3% mean state accuracy - Trained on Qwen3-4B-Thinking (262K context, 4B params)
Part of the Ellora project - standardized LoRA recipes for enhancing LLM capabilities. All recipes use self-supervised data generation and work with existing infrastructure (PEFT, LoRAX, vLLM).
๐ Adaptive Classifier v0.1.0: Now with ONNX Runtime Support!
We're excited to announce a major update to Adaptive Classifier - a flexible, continuous learning classification system that adapts to new classes without retraining!
What's New:
โก ONNX Runtime Integration: Get 1.14x faster CPU inference out of the box (up to 4x on x86 processors)
๐ฆ INT8 Quantization: Models are now 4x smaller with minimal accuracy loss, making deployment easier and faster
๐ฏ Smart Loading: Automatically uses the best model variant for your hardware - quantized for speed by default, or unquantized for maximum accuracy
๐ 7.5x Faster Model Loading: Get started quickly with optimized model initialization
How It Works:
Adaptive Classifier lets you build text classifiers that continuously learn from new examples without catastrophic forgetting. Perfect for: - Dynamic classification tasks where classes evolve over time - Few-shot learning scenarios with limited training data - Production systems that need to adapt to new categories
The new ONNX support means you get production-ready speed on CPU without any code changes - just load and run!
Try it now:
from adaptive_classifier import AdaptiveClassifier
# Load with ONNX automatically enabled (quantized for best performance) classifier = AdaptiveClassifier.load("adaptive-classifier/llm-router")
# Add examples dynamically classifier.add_examples( ["Route this to GPT-4", "Simple task for GPT-3.5"], ["strong", "weak"] )
# Predict with optimized inference predictions = classifier.predict("Complex reasoning task")
๐ Adaptive Classifier v0.0.17 Released - Major Accuracy Improvements!
We've just released a major update fixing critical bugs that were causing 40-50% accuracy drops in our enterprise classifiers!
Key Fixes: โข Fixed k-parameter prediction bug causing massive accuracy loss โข Improved incremental learning for new classes โข Enhanced weight preservation during model updates
Over 40 percent of AI-generated code contains security vulnerabilities. We recently worked on a LoRA to write secure code by default using automated Semgrep analysis and GRPO, achieving 97 percent reduction in vulnerabilities without requiring security-specific prompts.
Technical Approach: Automated security training pipeline combining Semgrep vulnerability detection with preference learning. Generate multiple solutions with varying security awareness, automatically analyze for vulnerabilities, create preference pairs based on security scores, train using GRPO with multi-factor scoring.
Scoring System (100 points total): - Functionality: 40 points - Does the code work correctly - Security patterns: 40 points - Uses secure coding practices - Low vulnerabilities: 20 points - Semgrep score below threshold
This balanced scoring prevents reward hacking where models generate empty functions to avoid vulnerabilities.
Real Transformation Examples:
Database query before: query = f"SELECT * FROM products WHERE name = '{name}'"
Database query after: query = "SELECT * FROM products WHERE name = ?" db.execute(query, (name,))
I recently worked on a LoRA that improves tool use in LLM. Thought the approach might interest folks here.
The issue I have had when trying to use some of the local LLMs with coding agents is this:
Me: "Find all API endpoints with authentication in this codebase" LLM: "You should look for @app.route decorators and check if they have auth middleware..."
But I often want it to search the files and show me but the LLM doesn't trigger a tool use call.
To fine-tune it for tool use I combined two data sources:
1. Magpie scenarios - 5000+ diverse tasks (bug hunting, refactoring, security audits) 2. Real execution - Ran these on actual repos (FastAPI, Django, React) to get authentic tool responses
This ensures the model learns both breadth (many scenarios) and depth (real tool behavior).
I wanted to share a technique that's been working really well for recovering performance after INT4 quantization.
Typically, quantizing the LLM to INT4 (unlike say INT8) for inference can incur some accuracy loss. Instead of accepting the quality loss, we used the FP16 model as a teacher to train a tiny LoRA adapter (rank=16) for the quantized model. The cool part: the model generates its own training data using the Magpie technique so no external datasets needed. This is critical because we want to remain as much as possible in the distribution of the model's natural responses.
Last year Apple's foundational models paper (https://arxiv.org/pdf/2407.21075) had proposed a similar technique and found "By using accuracy-recovery LoRA adapters with only rank 16, Alpaca win rate can be improved by 7-18%, GMS8K accuracy is boosted by 5-10%." (page 47).
We saw similar results on Qwen3-0.6B:
Perplexity: 2.40 โ 2.09 (only 5.7% degradation from FP16 baseline) Memory: Only 0.28GB vs 1.0GB for FP16 (75% reduction) Speed: 3.0x faster inference than FP16 Quality: Generates correct, optimized code solutions
Happy to answer questions about the implementation or help anyone trying to replicate this. The key insight is that quantization errors are systematic and learnable - a small adapter can bridge the gap without negating the benefits of quantization.
Has anyone else experimented with self-distillation for quantization recovery? Would love to hear about different approaches!
I recently added a recipe in ellora to improve reasoning capabilities to Gemma-3-1B using self-supervised learning. Model now shows step-by-step thinking in <think> tags before answering.
Logic puzzle accuracy: 61% โ 84%. 3 hours training on single GPU. ๐ง
Used GRPO where model generates multiple responses and learns to prefer better reasoning. Works surprisingly well for making smaller models more transparent.
Released 17 production-ready adaptive text classifiers that learn from just 100 examples per class and continuously improve without retraining.
These models achieve 93% average accuracy across enterprise use cases like email routing, fraud detection, document classification, and support ticket categorization. Built on ModernBERT with prototype memory and elastic weight consolidation.
Key benefits: 90% cost reduction vs API solutions, 90-120ms local inference, dynamic class addition, and zero vendor lock-in.
All models available under adaptive-classifier organization. Install with pip install adaptive-classifier.
๐งฌ We just published our comprehensive analysis of OpenEvolve - an open-source evolutionary coding agent that automatically optimizes algorithms using LLMs!
Our key findings from 29 experiments across 10 models:
- Gemini Flash 2.5 achieved 2.04x speedup across 30 benchmark tasks - Open models like Gemma 3 27B (1.63x) and Qwen3-Coder 480B (1.41x) rivaled proprietary models - The system discovered entirely new algorithms - not just code optimizations! - One task evolved from DFS to BFS to Union-Find approaches - Specialized coding models outperformed much larger general models 200 iterations beat 100 iterations by 24% - Ensembles surprisingly failed due to conflicting optimization strategies
Most fascinating: watching models evolve code step-by-step, like transforming matrix operations from basic eigendecomposition to vectorized one-liners with 32x speedup.
Our systematic experimental approach reveals that open-source evolutionary coding is becoming seriously competitive with proprietary solutions. We tested everything from temperature settings to evolution strategies to find optimal configurations.
This research shows automated code optimization is ready for real-world applications. The methodology we developed can guide anyone building evolutionary coding systems.
Extended the ICM paper to show cross-model capability transfer - used Qwen3's mathematical reasoning to improve Gemma3 without any human supervision.
Key results:
Qwen3-0.6B: 63.2 โ 66.0 on MATH-500 (+4%) Gemma3-1B: 41.0 โ 45.6 on MATH-500 (+11%)
The method extracts coherent reasoning patterns from one model via Internal Coherence Maximization, converts them to DPO training data, and uses that to improve a completely different model architecture. This goes beyond the original ICM paper which only improved models using their own labels. We're showing you can transfer capabilities between any models - imagine extracting capabilities from strong models to improve your local ones.
Planning to extend this to code generation next. The approach could enable community-driven capability sharing between different model families without expensive annotation.
Implemented Test-Time Diffusion Deep Researcher (TTD-DR) in OptiLLM! ๐
Just shipped a game-changing feature that turns any LLM into a powerful research agent. TTD-DR applies diffusion-inspired techniques to iteratively refine research reports while grounding them in real web sources.
How it works: โข Generates initial draft โข Identifies knowledge gaps โข Searches web for missing info โข Iteratively refines through "denoising" steps โข Produces comprehensive reports with 15-30+ sources
The magic? It works with ANY model so you can choose your favorite open-source models on HF!
Key results: - 47 complex research queries tested - Every report backed by real web sources - Quality rivals human research analysts - No more hallucinations on current events!
Try it: pip install optillm Then use "deep_research-your-model-name" as the model identifier
New research: Understanding how different LLMs approach reasoning through "thought anchors"
I just published a comparative study analyzing the reasoning patterns of Qwen3-0.6B vs DeepSeek-R1-Distill-1.5B using thought anchors - critical sentences that significantly impact task success probability.
Key findings: - DeepSeek-R1: Uses concentrated reasoning with fewer, high-impact steps (0.408 avg impact) - Qwen3: Employs distributed reasoning spreading impact across multiple steps (0.278 avg impact) - Different risk-reward profiles: DeepSeek more consistent (82.7% positive steps), Qwen3 more exploratory (71.6% positive)
This reveals different cognitive architectures rather than simple performance differences. The models optimize for different reasoning strategies - consistency vs exploration.
New SOTA for 26-circle packing problem! ypwang61 achieved 2.635977 sum of radii using OpenEvolve evolutionary optimization framework.
Progress: AlphaEvolve originally reported 2.635 in their paper, OpenEvolve made improvements, and now we have this new record at 2.635977.
The solution uses multi-stage optimization with specialized pattern initialization and enhanced penalty functions. Circle packing is a notoriously hard optimization problem where these small improvements actually represent significant algorithmic advances.
Great example of how evolutionary algorithms can push boundaries in computational geometry optimization. The implementation and results are shared openly on GitHub.
๐ Just published: "OpenEvolve: Open-Source Evolutionary Code Optimization with Real-World GPU Kernel Discovery"
We built the first open-source implementation of Google's AlphaEvolve system and used it to automatically discover GPU kernel optimizations that outperform human engineers!
Key results:
- 21.8% average decode speed improvement on Apple Silicon - 36.7% improvement on long-context transformer attention - Discovered novel vectorization patterns and 2-pass softmax algorithm
The system evolved a Metal kernel for Qwen3's Grouped Query Attention from a basic 3-pass implementation into something with sophisticated Apple Silicon optimizations that would take experts months to discover manually. The evolved kernel automatically found the optimal vec<T,8> operations for 128-dim attention heads and fused softmax computation with value accumulation.
Really excited about the potential here - imagine evolutionary algorithms automatically discovering optimizations across all our AI infrastructure. What would you want to optimize with this approach?
Adaptive Classifier: Dynamic Text Classification with Strategic Learning
New text classification system that learns continuously without catastrophic forgetting. Achieved 22.2% robustness improvement on adversarial datasets while maintaining clean data performance.
๐ฏ THE PROBLEM Traditional classifiers require complete retraining when adding new classes. Expensive and time-consuming, especially with adversarial users trying to game the system.
๐ KEY INNOVATIONS โข Hybrid memory-neural architecture (prototype-based + neural adaptation) โข Strategic classification using game theory to predict and defend against manipulation โข Elastic Weight Consolidation prevents catastrophic forgetting
๐ RESULTS Tested on AI-Secure/adv_glue dataset: โข Clean data: 80.0% โ 82.2% (+2.2%) โข Manipulated data: 60.0% โ 82.2% (+22.2%) โข Zero performance drop under adversarial attacks