A Practical Guide to POMDP-Based Localized Agents with Small Language Models

    This article examines how to bring Agent Skills, originally designed for large closed-source models, to locally hosted open-source small language models (SLMs) through a POMDP-based formalization. It covers the core decision types, skill representation, state-space definitions, and deployment practices such as model-size routing and supporting cloud infrastructure for compliance-sensitive industrial scenarios.

    A Practical Guide to POMDP-Based Localized Agents with Small Language Models

    In the current wave of AI applications, agent frameworks built on large models have shown remarkable potential. Common industry solutions often rely on very large closed-source APIs, which perform extremely well in general-purpose scenarios. However, when we turn to real industrial pain points, the situation is less optimistic. In high-confidentiality scenarios such as financial risk control and military-grade data isolation, continuously calling public APIs can be rejected outright under the combined pressure of compliance review and budget constraints.

    Faced with this engineering deadlock, researchers in academia and industry have raised a core question: can the Agent Skills framework originally designed for giant large models be pushed down to locally running open-source small language models (SLMs) and deliver comparable performance gains? To turn black-box “intuition” into quantifiable engineering metrics, researchers not only reconstructed Agent Skills with rigorous mathematical models at the底层 level, but also brought in a full spectrum of open-source models ranging from hundreds of millions to tens of billions of parameters and ran a stress test on realistic industrial datasets. This article analyzes the technical approach in depth to help developers choose appropriate model scales and routing strategies under limited hardware budgets and assemble a workable localized agent.

    1. Why Agent Skills Need to Be Formalized

    In traditional agent development, skill invocation often depends on the strong semantic understanding and implicit reasoning capabilities of large models. But for locally running small models, the context window and reasoning depth are limited, and they cannot process complex tasks “intuitively” through massive attention mechanisms like giant models. Therefore, rigorous mathematical modeling is needed to make the behavior logic of the agent system explicit, so that it can run stably and predictably in constrained environments.

    2. POMDP-Based Formal Definition of Agent Skills

    To precisely evaluate and optimize system behavior, the researchers abstracted the Agent Skill system as a constrained controller that searches for information in a partially observable world. At each decision step, the agent must balance task progress against limited attention and context resources, and faces three core decision choices:

    1. Commit to and execute a skill: when the belief state is sufficiently clear, directly invoke a confirmed skill.
    2. Reveal more information about the skill: under uncertainty, pay an additional cost (such as consuming more context tokens) in exchange for better observations.
    3. Take direct action in the environment: bypass the skill library and directly perform basic interaction or tool calls.

    Because the underlying system follows Markov dynamics and the agent cannot directly observe the true agent-task state, the system is naturally modeled as a partially observable Markov decision process (POMDP), with explicit information-acquisition actions added.

    3. Mathematical Representation of Skills and Core Mechanisms

    In this formal framework, each skill is defined as an abstract triple:

    • Text descriptor: contains the skill name and textual description. This is the “front door” of the skill, used for semantic matching with user intent at the initial stage. For small models, clear and structured text descriptors can significantly reduce misjudgment rates.
    • Internal policy: an intra-skill policy extended over time, i.e., an option-level process or workflow that triggers a sequence of actions. It specifies the concrete execution path after the skill is triggered and is key for small models to execute complex tasks reliably.
    • Reference mechanism: a mechanism that can reveal additional skill-related context and tools (and even pointers to other skills). It is formalized as a Markov kernel, enabling the agent to perform cascading skill calls and build complex task flows.

    4. In-Depth Definition of the POMDP State Space

    To turn POMDP theory into engineering practice, its core components must be defined rigorously:

    • State S: the possible hidden task situation. This includes the user’s true intent, the current stage or progress of the task, and objective facts in the environment that have not yet been retrieved. The state is invisible and must be inferred through observations.
    • Observation O: what the agent can access at time t. Examples include the current user input message, available conversation history, and any revealed or loaded resources and skills. Observations are the only basis for the agent’s decisions.
    • Action A: a rich action space that specifically includes skill selection, paid context acquisition, skill execution, environment/tool calls, and internal planning and reasoning actions.
    • Belief state: the core concept of POMDP, representing the agent’s probability distribution over the true state S given the observations and past actions so far. Small models need to continuously update the belief state to decide whether to keep collecting information or execute a skill decisively.

    5. Deployment Practices for Industrial-Grade Localized Agents

    After understanding the mathematical model above, how can this approach be implemented under limited hardware budgets?

    1. Model scale selection and routing configuration
    Across the full spectrum of open-source models, bigger is not always better. For simple intent recognition and skill routing tasks, models with hundreds of millions to one billion parameters can handle the job after quantization, with very fast response times. For tasks involving complex internal policy reasoning, models with tens of billions of parameters need to be scheduled. By configuring intelligent routing and dynamically allocating inference tasks according to the POMDP belief state, hardware utilization can be maximized.

    2. Use general cloud services to stabilize infrastructure
    Although the models run locally, a complete industrial-grade agent system still needs reliable underlying infrastructure. Developers can combine general services such as Baidu AI Cloud to reduce operational overhead. For example, object storage can be used to securely and efficiently manage large numbers of model weights and skill-library configuration files; message queues can enable asynchronous skill execution and state updates to avoid blocking the main inference thread; container platforms can provide elastic scheduling and failure recovery for local inference instances; and comprehensive logging and monitoring alerts can track agent performance at each POMDP decision node in real time. These standardized cloud capabilities can provide solid engineering support for localized agents without building complex operations systems from scratch.

    6. Conclusion

    Pushing the Agent Skills framework, once exclusive to large closed-source APIs, down to local open-source small models is not only a shift in technical路线 but also a re-examination of the underlying logic of agents. By introducing POMDP modeling, the agent’s decision process is transformed from black-box intuition into a quantifiable mathematical process, making it possible for small models to be applied in industrial high-confidentiality scenarios. In practice, developers should fully understand the evolution of belief states, configure full-spectrum model routing reasonably, and make good use of mature general cloud services to build localized agents that combine compliance, cost efficiency, and high performance within limited hardware budgets.