SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.20148 · 2026

Meta-Tool: Efficient Few-Shot Tool Adaptation for Small Language Models

Sachin Kumar

arXiv · PDF · Open in the Atlas

Code that ran

3 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2604.20148.json · badge: /api/ran/2604.20148.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
techsachinkr/Meta-Tool community
Papers with Code archive
3 ran · 3 no recorded run
FunctionStatusWhere it lives
LoRAWeights Ran
ran on a synthesized input · constructed an object; no result was computed
techsachinkr/Meta-Tool/hypernetwork.py
code served (permissive licence) · get_code("f843895721e5f969")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, LoRAWeights: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from typing import Dict, List, Optional

torch.manual_seed(0)

# Construct A_matrices - dict of small tensors
A_matrices = {
    "layer_0": torch.randn(4, 3),
    "layer_1": torch.randn(4, 2),
}

# Construct B_matrices - dict of small tensors
B_matrices = {
    "layer_0": torch.randn(5, 4),
    "layer_1": torch.randn(6, 4),
}

# Construct layer_indices
layer_indices = [0, 1, 2]

# Construct target_modules
target_modules = ["linear", "attention"]

# Define ARGS mapping all parameters
ARGS = {
    "A_matrices": A_matrices,
    "B_matrices": B_matrices,
    "layer_indices": layer_indices,
    "target_modules": target_modules,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LoRAWeights — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LoRAWeights output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ModelConfig Ran
ran on a synthesized input · constructed an object; no result was computed
techsachinkr/Meta-Tool/hypernetwork.py
code served (permissive licence) · get_code("7bf34a451b3f17c2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ModelConfig: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from typing import List
from dataclasses import dataclass, field

torch.manual_seed(0)

@dataclass
class ModelConfig:
    """Configuration for base and hypernetwork models.
    
    GPU MEMORY PRESETS - Choose based on your available VRAM:
    
    ┌─────────────────────────────────────────────────────────────────────┐
    │ GPU VRAM    │ Base Model                      │ Encoder             │
    ├─────────────────────────────────────────────────────────────────────┤
    │ 24GB+       │ meta-llama/Llama-3.2-3B-Instruct│ Llama-3.2-1B        │
    │ (4090/A6000)│ base_model_dim=3072, layers=28  │ encoder_dim=2048    │
    ├─────────────────────────────────────────────────────────────────────┤
    │ 12-16GB     │ microsoft/phi-2                 │ all-MiniLM-L6-v2    │
    │ (3090/4080) │ base_model_dim=2560, layers=32  │ encoder_dim=384     │
    ├─────────────────────────────────────────────────────────────────────┤
    │ 8-10GB      │ TinyLlama/TinyLlama-1.1B-Chat   │ all-MiniLM-L6-v2    │
    │ (3080/3070) │ base_model_dim=2048, layers=22  │ encoder_dim=384     │
    ├─────────────────────────────────────────────────────────────────────┤
    │ 4-6GB/CPU   │ facebook/opt-350m               │ all-MiniLM-L6-v2    │
    │ (Testing)   │ base_model_dim=512, layers=24   │ encoder_dim=384     │
    └─────────────────────────────────────────────────────────────────────┘
    """
    base_model_name: str = 'microsoft/phi-2'
    base_model_dim: int = 2560
    base_model_layers: int = 32
    encoder_model_name: str = 'sentence-transformers/all-MiniLM-L6-v2'
    encoder_dim: int = 384
    lora_rank: int = 16
    lora_alpha: float = 32.0
    lora_dropout: float = 0.05
    target_modules: List[str] = field(default_factory=lambda: ['q_proj', 'v_proj', 'k_proj'])
    latent_dim: int = 1024
    attention_dim: int = 512
    num_adapt_layers: int = 32
    device: str = 'cpu'
    dtype: torch.dtype = torch.float32

ARGS = {
    'base_model_name': 'microsoft/phi-2',
    'base_model_dim': 256,
    'base_model_layers': 4,
    'encoder_model_name': 'sentence-transformers/all-MiniLM-L6-v2',
    'encoder_dim': 128,
    'lora_rank': 8,
    'lora_alpha': 32.0,
    'lora_dropout': 0.05,
    'target_modules': ['q_proj', 'v_proj', 'k_proj'],
    'latent_dim': 64,
    'attention_dim': 32,
    'num_adapt_layers': 4,
    'device': 'cpu',
    'dtype': torch.float32,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ModelConfig — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ModelConfig output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
PrototypeAggregator Ran
ran on a synthesized input · constructed an object; no result was computed
techsachinkr/Meta-Tool/hypernetwork.py
code served (permissive licence) · get_code("20d892f0e750f574")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, PrototypeAggregator: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from dataclasses import dataclass, field
from typing import List, Optional

torch.manual_seed(0)

@dataclass
class ModelConfig:
    """Configuration for base and hypernetwork models."""
    base_model_name: str = 'microsoft/phi-2'
    base_model_dim: int = 2560
    base_model_layers: int = 32
    encoder_model_name: str = 'sentence-transformers/all-MiniLM-L6-v2'
    encoder_dim: int = 384
    lora_rank: int = 16
    lora_alpha: float = 32.0
    lora_dropout: float = 0.05
    target_modules: List[str] = field(default_factory=lambda: ['q_proj', 'v_proj', 'k_proj'])
    latent_dim: int = 1024
    attention_dim: int = 512
    num_adapt_layers: int = 32
    device: str = 'cpu'
    dtype: torch.dtype = torch.float32

# Create a minimal ModelConfig
config = ModelConfig(
    encoder_dim=8,
    attention_dim=6,
    device='cpu',
    dtype=torch.float32
)

# Build arguments dictionary
ARGS = {
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PrototypeAggregator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PrototypeAggregator output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
DocumentationEncoder Not yet run
unverified (harvested, no recorded run)
techsachinkr/Meta-Tool/hypernetwork.py
code served (permissive licence) · get_code("c133aab706b9452f")
How it ran

no invocation recorded.

FactorizedWeightGenerator Not yet run
unverified (harvested, no recorded run)
techsachinkr/Meta-Tool/hypernetwork.py
code served (permissive licence) · get_code("05d3eee2fa3bb051")
How it ran

no invocation recorded.

MetaToolHypernetwork Not yet run
unverified (harvested, no recorded run)
techsachinkr/Meta-Tool/hypernetwork.py
code served (permissive licence) · get_code("1c383492650cd00d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Can small language models achieve strong tool-use performance without complex adaptation mechanisms? This paper investigates this question through Meta-Tool, a controlled empirical study comparing hypernetworkbased LoRA adaptation against carefully designed few-shot prompting. Using a Llama-3.2-3B-Instruct backbone, we evaluate four adaptation mechanisms-few-shot prompting, documentation encoding, hypernetworkgenerated LoRA weights, and value-guided beam search-across four diverse benchmarks: Gorilla APIBench, Spider 2.0, WebArena, and InterCode. Our central finding is a wellsupported negative result: despite generating non-trivial weight matrices, the 227.8Mparameter hypernetwork provides no measurable improvement over few-shot prompting alone. Comprehensive ablation studies reveal that few-shot examples contribute +21.5% to performance and documentation contributes +5.0%, while the hypernetwork adds 0%. A 3B model with well-designed prompts achieves 79.7% of GPT-5's average performance at 10× lower latency. Error analysis across 722 failure cases spanning all shot counts (0-5) shows that at the 5-shot configuration (106 failures), failure modes are task-dependent: schema-heavy tasks (Spider 2.0, WebArena) show near-zero format errors with remaining failures semantic, while format errors dominate on Gorilla (100%) and InterCode (70%). These findings redirect practitioners toward prompt engineering and example curation rather than complex adaptation architectures. * This research was conducted independently and does not reflect the views or represent work done at LexisNexis. prise settings: frontier models like GPT-5 achieve strong tool-use performance but impose prohibitive latency and cost, while small language models (SLMs) offer efficiency but lack the procedural knowledge needed for domain-specific tools (Shen et al., 2025). The two dominant adaptation strategies-In-Context Learning (ICL) and Supervised Fine-Tuning (SFT)-represent opposing tradeoffs: ICL provides rapid flexibility but is constrained by context limits, while SFT yields strong performance but requires thousands of annotated trajectories and costly retraining as APIs evolve (Ghosh et al., 2024;Verma et al., 2024). Recent work on hypernetworks-secondary networks that generate task-specific parameter updates for a primary model-has shown promise for rapid adaptation in other NLP domains (Lv et al., 2024;Abdalla et al., 2025). A natural question is whether such mechanisms can bridge the tool-use adaptation gap: given a tool's documentation and a handful of usage examples, can a hypernetwork generate LoRA adapter weights that improve tooluse performance beyond what few-shot prompting alone provides? This paper investigates this question through a controlled empirical study, with a surprising answer: for tool-use tasks across four diverse benchmarks, the answer is no. The fewshot examples and documentation fully specify the task, and hypernetwork-generated parameter updates provide no additional benefit. Our code is available at https://github.com/ techsachinkr/Meta-Tool This paper presents Meta-Tool, an empirical investigation into what drives tool-use performance in small language models. Our primary contributions are: • Negative Result on Hypernetwork Adaptation: The first controlled demonstration-

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2604.20148")
get_code_for_paper("2604.20148")
have("2604.20148")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2604.20148.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2604.20148.svg)](https://syntology.ai/paper/2604.20148)

Connect an agent — have() is free.