Running Agent Frameworks on Small Models: A POMDP-Based Approach to Local Deployment
This article examines whether Agent Skills frameworks originally designed for large language models can be effectively deployed on smaller, locally hosted models. It introduces a formal methodology based on Partially Observable Markov Decision Processes (POMDP) to analyze the problem, covering the mathematical representation of Agent Skills, the specific capability bottlenecks of small models, and practical engineering recommendations for local deployment.
Introduction: When Agent Frameworks Meet Small Models
As Agent technology evolves rapidly, a practical concern faces developers: can the Agent Skills orchestration frameworks built for massive language models also work on small-scale models running locally? If so, where is the boundary of performance degradation? If not, what engineering trade-offs are necessary?
The engineering motivation behind this question is strong. Local deployment means lower inference costs, better data privacy protection, and more controllable latency. However, small models have objective gaps compared to large models in areas such as instruction following, multi-step reasoning, and tool invocation. Directly applying Agent frameworks designed for large models to small models without analysis often yields poor results—frequent skill selection errors, context management failures, or loss of task state during multi-turn interactions.
To transform this “black-box intuition” into quantifiable and optimizable engineering metrics, researchers have proposed a formal framework based on Partially Observable Markov Decision Processes (POMDP). This framework abstracts the Agent Skill system as a controller performing information-seeking in a partially observable environment. This article starts from this framework to systematically review the mathematical modeling approach for Agent Skills, the capability bottleneck analysis of small models, and engineering decision recommendations for local deployment.
Why POMDP? The Core Challenges of Agent Systems
Before diving into technical details, it is worth addressing a foundational question: why choose POMDP as the modeling tool?
The core challenges facing Agent systems can be grouped into three points:
First, the state is not fully observable. The agent cannot directly “see” the user’s true intent, the current stage of the task, or facts in the environment that have not yet been retrieved. It can only infer the state through limited observations—the current conversation, historical records, and loaded resources. This naturally corresponds to the concept of “belief states” in POMDP.
Second, actions carry informational value. Each step of an agent is not just about “doing things” but may also be about “acquiring information.” For example, choosing to load a detailed description of a skill, retrieving additional tool lists, or asking the user for clarification—these actions do not directly advance the task but improve the quality of subsequent decisions. Standard MDPs cannot capture this “exchanging cost for information” behavior, whereas POMDPs natively support the modeling of information-gathering actions.
Third, resource constraints are hard constraints. Limited context windows, inference latency ceilings, and API call budgets mean the agent must weigh “continue exploring” against “execute immediately.” The POMDP framework formalizes this trade-off as a comparison between expected rewards and information-gathering costs.
Modeling the Agent Skill system as a POMDP is not just for theoretical elegance—it provides clear targets for engineering optimization: which parameters affect skill selection accuracy? When does the marginal benefit of information gathering diminish? How does model scale affect the convergence speed of belief states? These questions all take on analyzable forms within the POMDP framework.
The Three-Part Mathematical Representation of Agent Skills
Within the POMDP framework, each Agent Skill is defined as an abstract three-part tuple containing three core components:
Text Descriptor
The text descriptor is the “interface specification” that a skill exposes externally, containing the skill name and a natural language description. It plays a dual role: one is to help the routing module determine whether the current situation should activate the skill, and the other is to help the model understand the skill’s applicable boundaries.
For small models, design of the text descriptor is particularly critical. Large models have strong semantic generalization capabilities; even vague descriptions allow them to make reasonable judgments. Small models, however, rely more heavily on the precision and distinctiveness of descriptors. In engineering practice, descriptors should avoid ambiguity, avoid semantic overlap with other skills, and include explicit hints about “when to use” and “when not to use.”
Internal Policy
The internal policy is the execution logic within a skill, unfolding over time as a sequence of actions. It can be a fixed workflow or a process dynamically decided by the model. From a mathematical perspective, the internal policy defines an option-level decision process—once a skill is activated, the agent enters the skill’s “internal state space” and executes step by step according to its policy.
The complexity of the internal policy directly determines the model capabilities required. Simple single-step tool invocation demands less from the model, whereas complex policies involving multi-step reasoning, conditional branching, and error recovery require the model to possess stronger long-horizon planning capabilities.
Referencing Mechanism
The referencing mechanism allows a skill to “reveal” additional context information when needed—including associated tools, dependent skills, or supplementary documentation. Formally, the referencing mechanism is modeled as a Markov kernel: given the current state and action, it transitions to a new information state with a certain probability, revealing which resources get loaded.
The referencing mechanism is the core carrier of an Agent system’s “on-demand information acquisition” capability. It allows the agent to avoid stuffing all skill descriptions and tool documentation into the context at the initial stage, instead progressively revealing them as the task advances. This is especially important for small models—the precious space in the context window needs to be reserved for the most relevant information.
# Illustrative structure of the skill tripleskill = {"descriptor": {"name": "Data query and summarization","description": "Use this skill when the user needs statistical information from structured data sources."},"policy": ["Parse dimensions and metrics from the user query","Construct and execute the query statement","Format and summarize the results"],"reference": {"tools": ["Query engine interface", "Formatting tool"],"related_skills": ["Report generation skill"],"reveal_condition": "Load the summarization tool when the query result exceeds a preset row count"}}
Detailed Definitions of POMDP Elements
State Space
The state space S contains all potentially hidden task context elements:
- User intent: what the user truly wants to accomplish, which may not be fully expressed in the initial message.
- Task stage: whether the current task is in the information-gathering, solution-design, execution, or result-confirmation phase.
- Environmental facts: data not yet retrieved, tool states, system configurations, and so on.
The state space can be very large or even continuous, which means the agent must rely on observations to maintain a belief state rather than knowing the true state exactly.
Observation Space
The observation space O defines the information the agent can access at time t, including:
- Current user message and conversation history
- Loaded skill descriptors and tool documentation
- Results returned from skill execution
- System state information (such as context usage and remaining budget)
The design of observations directly affects the information-gathering strategy. If observations are too sparse, the agent needs more exploration actions; if observations are too noisy, the efficiency of belief state updates decreases.
Action Space
The action space A contains four types of actions:
- Skill selection: choosing a candidate skill from the available skill set.
- Paid context acquisition: paying extra cost (token consumption, increased latency) to reveal more information about a skill or tool.
- Skill execution: activating the selected skill and executing according to its internal policy.
- Environment/tool invocation: directly interacting with external tools, as well as internal planning and reasoning.
The clarity of this four-way action partition allows the POMDP model to characterize the “exploration-exploitation” trade-off: skill selection and direct execution lean toward exploitation, while paid context acquisition leans toward exploration.
Belief State
The belief state b(s) represents the agent’s probability distribution over the true state given the history of observations and actions. Belief state updates follow Bayes’ rule:
b’(s’) ∝ O(o|s’) · Σ_s T(s’|s,a) · b(s)
where T is the state transition function and O is the observation function. The dimensionality of the belief state grows with the size of the state space, so practical systems typically use approximation methods (such as particle filters or parameterized belief representations) to maintain computational feasibility.
For small models, maintaining the belief state is a key challenge. The model needs to preserve enough historical information within a limited context window to approximate the belief distribution, while also leaving room for the current decision. This raises an important engineering question: how to design observation summarization mechanisms that compress history while retaining the signals most critical for state inference.
Capability Bottleneck Analysis of Small Models in the POMDP Framework
With the formal framework in place, we can systematically analyze the capability boundaries of small models in Agent Skills scenarios. From the perspective of POMDP elements, the following key bottlenecks emerge:
Skill Selection Accuracy and Model Scale
Skill selection is essentially an observation-based decision problem: given the current context and the set of skill descriptors, select the skill most likely to advance the task. The accuracy of this decision is affected by the model’s semantic understanding capability and its tolerance for context length.
Small models are prone to skill selection errors in the following scenarios: semantic overlap among skill descriptors, ambiguous user requests, and distracting information in conversation history. The cost of these errors is direct—selecting the wrong skill not only wastes time but may also introduce incorrect context, further degrading subsequent decisions.
Planning Capability for Information-Gathering Strategies
One of the core advantages of the POMDP framework is that it explicitly models information-gathering actions. However, making sound information-gathering decisions requires the model to evaluate “whether current information is sufficient to support a decision” and “whether the expected benefit of acquiring additional information outweighs its cost.” This metacognitive capability demands more from the model.
Small models tend to fall into two extremes: either being overconfident and executing directly without sufficient information, leading to errors; or over-exploring and repeatedly loading unnecessary information, causing context overflow. Calibrating this trade-off requires additional engineering measures, such as explicit confidence thresholds or rule-based triggers for information gathering.
Stability of Long-Horizon Internal Policy Execution
When a skill’s internal policy involves multi-step reasoning and conditional branching, small models show a notable decline in execution stability. Specific symptoms include error accumulation across intermediate steps, forgetting of earlier instructions, and a lack of recovery capability when encountering unexpected results.
The concept of “intra-skill policy” in the POMDP framework reminds us that skill execution is not a single-step action but a process extended over time. For small models, skill designs with shorter internal policies and simpler branching logic should be preferred, or complex policies should be decomposed into combinations of simpler skills.
Engineering Decision Reference: Selection and Configuration for Local Deployment
Based on the above analysis, the following engineering recommendations for local Agent deployment can be offered. These recommendations are presented as general technical principles, not tied to any specific model or platform.
Model Scale Selection Logic
Model scale selection should not follow the principle of “use the largest available” but rather “match task complexity.” It is recommended to evaluate along the following dimensions:
- Skill selection complexity: If the number of skills is small and the descriptors are highly distinguishable, a smaller model may suffice; if the number of skills is large and semantically similar, a larger model is needed to ensure discrimination accuracy.
- Information-gathering frequency: If tasks require frequent information exploration actions, the model needs stronger metacognitive capabilities, suggesting a larger model or the introduction of external routing logic.
- Internal policy steps: Single-step or two-step skills place low demands on the model; multi-step skills require stable long-horizon execution capability.
A practical strategy is layered routing: use a small model for high-frequency, simple skill selection and execution; escalate to a larger model when confidence falls below a threshold or task complexity exceeds a preset level. This routing mechanism can strike a balance between cost and performance.
Engineering Optimization of Skill Descriptors
For small-model scenarios, skill descriptor design should follow these principles:
- Prioritize discriminability: ensure that the descriptors of any two skills have clear semantic distinction, avoiding overly generic phrasing.
- Explicit usage conditions: clearly state “when to use” and “when not to use” in the description to reduce the model’s judgment burden.
- Length control: descriptors should not be too long, to avoid consuming excessive context space; but neither should they be too short, to avoid insufficient information.
Explicit Design of Information-Gathering Strategies
Do not rely entirely on the model to autonomously decide when to acquire information. It is recommended to design explicit trigger rules at the Agent framework level:
- When the confidence of skill selection falls below a threshold, trigger an information-gathering action.
- When context usage reaches a preset ratio, prohibit further information gathering and force a transition to execution or summarization.
- When multiple consecutive steps produce no effective progress, trigger user clarification or task replanning.
These rules are simple yet effective in compensating for the metacognitive shortcomings of small models, making system behavior more controllable.
Context Management Strategies
The context window of a small model is a scarce resource. The following management strategies are recommended:
- On-demand loading: skill descriptors and tool documentation are loaded only when needed, rather than all at once in the initial context.
- Hierarchical summarization: maintain layered summaries of conversation history—recent exchanges in detailed form, older exchanges compressed into key information.
- Explicit state tracking: maintain a structured task state summary (current stage, completed steps, pending items) at a key position in the context to help the model maintain direction during long conversations.
Conclusion
Can small models run Agent Skills? The answer is yes, provided that capability boundaries are acknowledged and targeted engineering adaptations are made. The value of the POMDP formal framework lies in decomposing the vague question “can small models do it” into a series of analyzable sub-problems: the decision accuracy of skill selection, the planning capability for information gathering, the stability of internal policy execution, and the efficiency of belief state maintenance.
From an engineering practice perspective, the deployment of local Agents is not simply about “picking a model and applying a framework.” It requires coordinated optimization across multiple dimensions, including model selection, skill design, routing strategy, and context management. A reasonable approach is to start with simple scenarios, validate the basic workflow with a small model, and then gradually adjust model scale or introduce routing mechanisms based on actual bottlenecks. For scenarios with a large number of skills and high task complexity, layered routing and explicit information-gathering rules are engineering measures worth trying first.
As small model capabilities continue to improve and Agent frameworks mature, the practical boundary for local Agents will keep expanding. But regardless of how the technology evolves, the core logic revealed by the POMDP framework remains unchanged: in a partially observable world, every decision an agent makes is a trade-off between the cost of information gathering and the benefit of task progress. Understanding this logic is the starting point for building reliable Agent systems.
