Evolutionary Context Search for Automated Skill Acquisition
Organizations: Sakana AI, Japan · Institute of Science Tokyo, Japan
Abstract
Large Language Models cannot reliably acquire new knowledge post-deployment -- even when relevant text resources exist, models fail to transform them into actionable knowledge without retraining. Retrieval-Augmented Generation attempts to bridge this gap by surfacing relevant documents at inference time, yet similarity-based retrieval often fails to identify context that actually improves task performance. We introduce Evolutionary Context Search (ECS), an evolutionary method that searches context combinations using accuracy on a small development set, requiring only inference calls without weight updates. ECS moves beyond semantic similarity to discover non-obvious context pairings that significantly boost performance. Our empirical results show that ECS improves BackendBench by 27% and -bench airline by 7%. The evolved contexts are model-agnostic, as those evolved with Gemini-3-Flash transfer effectively to Claude Sonnet and DeepSeek. This suggests that ECS opens a path toward automated context discovery for skill acquisition -- an efficient alternative to manual prompt engineering or costly fine-tuning.
Figures & tables
| Method | Pass 1 | Pass 2 | Pass 3 |
| Plain LLM | 0.622 | 0.489 | 0.400 |
| Random | 0.650 | 0.556 | 0.500 |
| BM25 | 0.641 | 0.550 | 0.483 |
| Full | 0.717 | 0.628 | 0.550 |
| ECS (Ours) | 0.767 | 0.710 | 0.683 |
| Claude-4.5-Sonnet | DeepSeek-V3.2 | |||||
| Metric | Plain | Full | ECS | Plain | Full | ECS |
| Pass 1 | 0.600 | 0.678 | 0.678 | 0.583 | 0.633 | 0.600 |
| Pass 2 | 0.506 | 0.561 | 0.617 | 0.478 | 0.500 | 0.472 |
| Pass 3 | 0.450 | 0.500 | 0.583 | 0.417 | 0.417 | 0.417 |
| # Tokens | 0 | 5491 | 848 | 0 | 5491 | 848 |
| (a) Evolved Context | (b) RAG Baseline | (c) With Evolved Context |
| hopper/fmha.py (lines 1372–1384) | DeepSeek generates wrong API | DeepSeek generalizes correctly |
| ⬇ 1 for j in range_constexpr (...): 2 acc_qk_mn [ i , j ] = cute.math.exp2 ( 3 scale_softmax_log2 4 * acc_qk_mn [ i , j ] | ⬇ 1 input_val = gA [ tidx ] 2 # WRONG: ArithValue is symbolic! 3 result = math.atan ( input_val ) | ⬇ 1 input_val = gA [ tidx ] 2 # CORRECT: DSL intrinsic 3 result = cute.math.atan ( input_val ) |
| cute.math.* pattern | Fails: stdlib on symbolic value | Works: DSL intrinsic |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Category | Operator | Signature | Description |
| Trigonometric Functions | |||
| acos | Computes element-wise inverse cosine (arccosine) of the input tensor. | ||
| acosh | Computes element-wise inverse hyperbolic cosine: . | ||
| asin | Computes element-wise inverse sine (arcsine) of the input tensor. | ||
| asinh | Computes element-wise inverse hyperbolic sine: . | ||
| atan | Computes element-wise inverse tangent (arctangent) of the input tensor. | ||
| Operator | Plain | Random | Chunk | AST | AST | AST | ECS |
| LLM | +Dense | +Dense | +BM25 | +Hybrid | (Ours) | ||
| acos.default | 0.333 | 0.444 | 0.444 | 0.778 | 0.667 | 0.222 | 0.778 |
| acosh.default | 0.333 | 0.444 | 0.778 | 0.667 | 0.667 | 0.667 | 0.778 |
| addmm.default | 0.333 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| addmv.default | 0.167 | 0.000 | 0.167 | 0.000 | 0.000 | 0.000 | 0.222 |
| addbmm.default | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| Statistic | Value |
| Total training samples | 117 |
| Average sequence length | 15,940 tokens |
| Samples truncated (to 14K tokens) | 24 |
| Source Python files | 62 |
| Source Jupyter notebooks | 12 |
| By GPU Architecture | |
| Hyperparameter | Value |
| Base Model | Qwen3-8B |
| Fine-tuning Method | LoRA (rank=8, =32) |
| Trainable Parameters | 21.8M (0.27%) |
| Learning Rates | {1e-6, 5e-6, 1e-5, 5e-5, 1e-4} |
| Global Batch Size | 64 |
| Epochs | 15 |
Retrieval-Augmented ICL
Retrieval-augmented in-context learning (ICL) selects relevant examples or knowledge to help models adapt without updating their weights.
See all 45 papers