Small Models + Agent Skills: A POMDP-Based Guide to Building Local Agents

    Packaging domain expertise as reusable "skills" that a base model selects and executes on demand has become a common way to extend agent capabilities. This paradigm works well on very large models, but it rests on three implicit assumptions—ample context, stable instruction following, and strong planning and self-correction—that typically break down for the open-source small language models (SLMs) running on consumer GPUs and edge devices. This article draws on a research framework that models skill-based agents as a partially observable Markov decision process (POMDP), turning model selection, information disclosure, and context consumption into measurable, tunable quantities. It then translates that view into an engineering methodology covering skill library design, budget-aware decision-making, routing strategies, and local deployment, so you can answer a concrete question: under a fixed hardware budget, what model size, skill library, and routing setup will yield a stable, controllable local agent.

    1. Introduction: What Small Models Still Lack for Agent Skills

    Packaging domain expertise as reusable “skills,” then letting a base model select and execute them on demand, has become a common way to extend agent capabilities—we can call this skill-based agency (Agent Skills). Each skill typically includes a description, an internal workflow, and callable resources. The model must decide when to use which skill, whether to read the skill’s instructions, and when to call tools directly.

    This paradigm performs well on very large models, but it relies on three implicit assumptions:

    • Ample context: the full skill catalog fits inside the prompt;
    • Stable instruction following: the model accurately selects skills and calls tools as described;
    • Strong planning and self-correction: the model maintains state across multi-step tasks.

    In local deployments, none of these assumptions reliably holds. Open-source small models in the 10B range and below—running on consumer GPUs or edge devices—face three constraints:

    • Limited context: within a window of a few thousand to tens of thousands of tokens, the skill catalog crowds out the context the task itself needs;
    • Weaker capabilities: instruction following, multi-step planning, and function-call reliability fall short of larger models;
    • Tight budgets: compute, VRAM, and latency ceilings are fixed.

    So the question “Can small models + Agent Skills work?” cannot be answered by intuition alone. Rather than stopping at prompt tricks, a research team at an overseas university and research institutions mapped a full spectrum of open-source models from 270 million to 80 billion parameters and evaluated them on datasets close to industrial use. They modeled skill-based agency as a partially observable Markov decision process (POMDP), turning model choice, information disclosure, and context consumption into quantifiable quantities.

    This article reorganizes that work into an engineering methodology. Its endpoint is a concrete question: under a limited hardware budget, what model size should you choose, and how should you design the skill library and routing, to build a stable, controllable local agent?

    2. Problem Breakdown: Why Model This with a POMDP

    2.1 The Gap Between Implicit Assumptions and Local Reality

    Implicit assumption Reality with local small models Engineering consequence
    The skill catalog fits entirely in the prompt Limited context; the catalog crowds out task reasoning space Lower selection accuracy; skills must be loaded on demand
    Stable instruction following Format drift, frequent argument errors Needs structured output constraints and external validation
    Multi-step state maintained on its own Weak long-horizon planning; constraints get lost mid-task Skill progress must be externalized explicitly
    The timing of exploration judged on its own Small models struggle to decide “when to look more” Information gathering must be managed as a cost-bearing action

    2.2 Three Key Characteristics

    Placing a skill-based agent inside a POMDP framework makes sense because it exhibits three characteristics:

    1. Partially observable state: the user’s true intent, the task’s current stage, and facts not yet retrieved do not appear in the prompt automatically.
    2. Markov property: both the environment and skill progression depend only on the current state. A skill is itself an “option-level” process that, once selected, unfolds across several steps over time.
    3. Information gathering has a cost: every additional piece of skill instructions read or every extra tool call consumes context and compute.

    At each step, then, the agent is really making one of three kinds of decisions:

    • Submit and execute some skill;
    • Reveal more information about that skill or its referenced resources;
    • Skip skills and interact with the environment directly.

    “Revealing information” can be understood as an action with a price tag. Through this design, researchers turn the “intuition” once hidden inside prompt engineering into engineering parameters that can be measured and tuned.

    3. Formal Foundations: Describing a Skill with a Triple

    Under the POMDP framework, a skill σ is abstracted as a triple (d, π, R), each element playing one of the roles “being selected,” “being executed,” and “being expanded”:

    1. Text descriptor d: the skill’s name and description—the entry point for skill selection.
    2. Internal policy π: the temporal sequence executed once the skill is selected, i.e., a set of consecutive action steps.
    3. Reference mechanism R: the capability to reveal more relevant context or tools, which can also point to other skills. It is formalized as a Markov kernel, using conditional probabilities to describe the distribution of the next observation given an action.

    Correspondingly, the whole system is denoted M = (S, O, A, T, Z, R, γ):

    • S (state space): possible hidden task situations, including user intent, task stage and progress, and environmental facts not yet retrieved;
    • O (observation space): what the agent can access at each moment, such as the current user message, visible history, and resources or skills already revealed or loaded;
    • A (action space): skill selection a_s, cost-bearing information gathering a_r (revealing a skill description or referenced resource), skill execution a_e, and environment/tool calls a_env, along with internal planning and reasoning;
    • T, Z: the state-transition kernel and observation kernel, describing how the environment evolves and how the agent perceives it;
    • R (reward function): composed of task goals together with the various overheads;
    • γ (discount factor): controls how much the agent weighs immediate versus future rewards.

    The belief state b_t that the agent maintains is the posterior estimate of the true state given the observation history and past actions.

    A Simplified Execution Loop

    The formal model can be reduced to a four-stage cycle:

    1. Maintain belief b_t (the context window is its approximate carrier)
    2. │
    3. ▼
    4. Select action: execute skill / reveal information / call tool directly
    5. │
    6. ▼
    7. Receive observation o_{t+1}: skill results, tool returns, newly revealed context
    8. │
    9. ▼
    10. Compute immediate payoff: task utility − context and compute overhead
    11. │
    12. └──────────► back to belief update

    This view yields two engineering insights:

    1. The genuinely scarce resource for a local agent is the “context budget,” not the stock of knowledge;
    2. Selecting and revealing skills are themselves cost-bearing decisions and should be modeled explicitly, rather than treated by default as “free” reasoning steps.

    4. Evaluation Methods: How to Validate an Industrial-Grade Local Agent

    To answer “can small models use skills well?” open-ended benchmarks alone are not enough. Real business tasks have long-tailed distributions, many cross-scenario cases, and noisy tool returns. A dataset close to industrial use, paired with full-scale model comparisons, better matches real deployment conditions.

    4.1 Comparisons Across Three Dimensions

    • Model size: from 270 million to 80 billion parameters, spanning tiny models to large models runnable locally. The key is to find the inflection point on the “capability-cost” curve—the minimum size at which a model can begin handling complex, multi-skill tasks.
    • Skill organization: full catalog, grouping by domain, and reveal-on-demand strategies compared in sequence, to test how the context budget constrains the upper bound on skill count.
    • Routing strategy: executed by a small model alone; routed by task type to an appropriately sized model; or a cascade where the small model tries first and escalates to a larger model when necessary.

    4.2 Five Metric Groups to Watch

    1. Task effectiveness: task success rate, first-attempt success rate, human takeover rate;
    2. Context efficiency: cumulative context consumption, share occupied by the skill catalog, compression ratio;
    3. Behavioral quality: skill selection accuracy, repeated-reveal rate (re-reading the same skill instructions), rate of meaningless tool calls;
    4. Engineering cost: per-task latency, compute overhead per task, VRAM usage;
    5. Interpretability: distribution of failure causes, such as wrong skill selection, argument errors, or dropped steps mid-task.

    4.3 Patterns Drawn from the Results

    Based on analysis and observations from this kind of framework, a few engineering patterns emerge (these are general trend judgments; specific numbers depend on the task and hardware and must be measured):

    1. A threshold effect exists in scale: some tasks require stable instruction following or correct argument formatting, and models that are too small fail frequently—failures that cannot be fixed by adding more to the prompt. Once size crosses a certain range, success-rate gains flatten out.
    2. Skill count and model size must be matched inversely: the more concise and decision-friendly the skill descriptions, the higher a small model’s selection accuracy; and the smaller the model, the fewer skills it can reliably manage.
    3. Explicit state is a compensating mechanism: moving state such as skill progress and confirmed arguments out of the model’s “memory” and into structured variables can narrow the gap between models of different sizes.
    4. The efficiency gap is often larger than the capability gap: at equal success rates, small models usually do not hold an advantage in context consumption, turn count, or latency—and can even do worse due to “can’t recall → re-check → retry repeatedly.” This shows that “usable” and “worth using” are two different questions.

    5. Practical Implementation: From Formalism to a Runnable System

    5.1 Skill Library Design

    1. Make descriptions decidable: spell out trigger conditions, non-applicable cases, inputs and outputs, and failure signals; avoid vague wording like “advanced” or “intelligent.”
    2. Limit the number of visible skills: have the model choose only from a slimmed-down skill set each time, avoiding the accuracy drop that comes from too wide a selection.
    3. Flatten reference chains: if a referenced skill itself keeps referencing further skills, small models easily lose their way. Inline sub-skill content directly, or assemble the prompt dynamically in code based on the reference graph, and cap the expansion depth.
    4. Unify naming and ordering: give skills a namespace, adopt a “verb + object” naming convention, and keep a stable ordering within the same task domain to reduce the model’s cognitive load.

    Here is a description template you can apply directly:

    1. Skill name: db.query_users (namespace: data queries)
    2. Applicable when: the user needs to query user records by condition
    3. Not applicable: write or delete operations (use db.update / db.delete)
    4. Inputs: filters (condition object), limit (number of rows to return, default 20)
    5. Outputs: a JSON array with fields id, name, created_at
    6. Failure signals: two consecutive empty results, or the tool reports an argument validation error

    5.2 Budget-Aware Decision Policy

    Solving a POMDP exactly is computationally infeasible, so engineering practice relies on approximate rules. The most direct approximation is “context-budget awareness”: set an acceptable context ceiling per task and let the agent reveal information only when there is ample headroom; otherwise, submit for execution first.

    1. from dataclasses import dataclass
    2. # Illustrative code: expresses structure only; specific thresholds must be
    3. # determined empirically by model size and hardware.
    4. @dataclass
    5. class Budget:
    6. max_tokens: int # per-task context ceiling
    7. used_tokens: int = 0 # context consumed so far
    8. def can_reveal(self, cost: int) -> bool:
    9. # Reserve part of the context for skill execution and result write-back
    10. return self.used_tokens + cost < self.max_tokens * 0.6
    11. class LocalAgent:
    12. def __init__(self, model, skills, tools):
    13. self.model, self.skills, self.tools = model, skills, tools
    14. self.state = {} # externalized skill progress and confirmed arguments
    15. def run(self, task: str):
    16. budget, history = Budget(max_tokens=16000), [{"role": "user", "content": task}]
    17. while budget.used_tokens < budget.max_tokens:
    18. if budget.can_reveal(cost=800) and not self._enough_info(history):
    19. # Action a_r: reveal skill instructions or referenced resources,
    20. # explicitly accounting for the cost
    21. snippet = self.skills.reveal(history)
    22. history.append({"role": "system", "content": snippet})
    23. budget.used_tokens += 800
    24. continue
    25. # Actions a_s + a_e: select and execute a skill; structured output
    26. # makes external validation easier
    27. call = self.model.invoke(history, schema=self.skills.current_schema())
    28. if call.skill is None: # no matching skill: call the tool directly
    29. result = self.tools.invoke(call.tool, call.args)
    30. else:
    31. result = self.skills.execute(call.skill, call.args, state=self.state)
    32. history.append({"role": "assistant", "content": str(result)})
    33. budget.used_tokens += len(str(result))
    34. if self.skills.is_done(self.state):
    35. return self.skills.summarize(self.state)
    36. return self.fallback(task) # fall back when the budget is exhausted

    This illustrative code maps onto the four POMDP stages:

    • history and state together carry the belief b_t;
    • can_reveal turns information gathering into a budget-constrained action;
    • structured output lowers the probability of format errors;
    • a fallback policy runs when the budget is exhausted, preventing infinite loops.

    5.3 Routing Strategies

    In heterogeneous local environments, a single model struggles to balance cost and effectiveness. There are four common routing approaches:

    • Route by skill domain: inject only the relevant domain’s skills into the execution model, based on task keywords or a lightweight classifier;
    • Cascade by scale: let a small model try first, then hand off to a larger model deployed on the same machine when confidence is low or validation fails;
    • Route by task type: send simple Q&A and retrieval tasks to the small model, and multi-skill combinations and long-horizon planning to a larger model;
    • Joint quality-cost decision: choose the model based on “expected payoff minus expected cost,” not simply on a capability ranking.

    To judge whether routing is effective, measure the success-rate gain each escalation to a larger model provides, and compare it against the corresponding latency and compute overhead. If an escalation yields little gain, the problem lies in skill library design or state externalization—not model size—and stacking more models is pointless.

    5.4 Local Deployment Essentials

    • Model and quantization: choose model size and quantization precision based on VRAM and latency requirements. Quantization usually cuts VRAM usage substantially, but can cause performance regressions on some instruction-following and formatting tasks, so validate against your actual task set.
    • Structured output constraints: define clear parameter schemas for skill calls and validate the format during decoding or post-processing to reduce wasted retries.
    • Observability: log skill selections, information reveals, tool calls, and context consumption as structured records, so it is easy to pinpoint whether the failure was “picked wrong” or “looked too little.”
    • Resource elasticity: during traffic peaks, common cloud capabilities—containers, object storage, logging, and monitoring/alerting—can support deploying the inference service, distributing skill resources, and monitoring the running system.

    5.5 Selection Recommendations: A Decision Path Under a Limited Budget

    1. Clarify the task’s capability requirements: is it a structured task like filling in arguments, or does it need long-horizon planning and multi-skill combinations? The former is friendlier to small models.
    2. Select by a success-rate threshold, not a size ranking: use a real task set to measure the minimum model size that meets your quality requirements.
    3. Tune the skill library and model together: first slim down descriptions, externalize state, and tighten reference relationships—then consider increasing model size.
    4. Let routing allocate cost: assign most tasks to the small model, reserving larger models or human backup for the few complex tasks.

    Only after validating each step along this path can you assemble a local-agent solution that balances effectiveness and cost. Small models can indeed use Agent Skills—but doing so requires systematic adaptation in skill organization, state management, and routing design. The value of the POMDP framework lies precisely in turning “how much to look and what to do” into a quantifiable, tunable engineering problem.