Manuscript Offprint

arXiv:2610.09588

Adaptive Code Generation for Controlling Robots

Justus Flerlage, Thorsten Wittkopp, Alexander Acker, Odej Kao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Justus Flerlage 1^{1}, Thorsten Wittkopp 1,2^{1,2}, Alexander Acker 2^{2}, and Odej Kao 1^{1}

1^{1} Technische Universität Berlin, Germany

{j.flerlage, t.wittkopp, odej.kao}@tu-berlin.de

2^{2} logsight.ai, Berlin, Germany

{thorsten.wittkopp, alexander.acker}@logsight.ai

Abstract. Deploying robots as Complex Adaptive Systems (CAS) in unknown and dynamic environments necessitates a transition from rigid command libraries toward intention-based autonomy, as natural language represents the only medium capable of articulating complex goals beyond the capacity of finite instruction sets. While Large Language Models (LLMs) offer a path toward natural language goal description, their integration introduces significant challenges: the formalization gap between imprecise intentions and executable actions, the taxonomy gap induced by unpredictable environments, and the challenge of maintaining temporal state and progress awareness. This work introduces an architectural framework that enables robotic control by leveraging generative AI. The system follows a dual-AI design: an LLM translates high-level intentions into executable program code restricted to a formal robotic library and constrained by verifiable syntax, while a Vision-Language Model (VLM) provides semantic grounding via a distillation process. To ensure robustness, the framework incorporates environment-driven replanning triggers based on geometric and semantic thresholds, complemented by continuous runtime monitoring and an adaptive planning loop. Benchmarked across frontier models, our framework architecture demonstrates that grounding generative AI in a reactive, constrained loop enables robust fulfillment of complex intentions in dynamic and unknown environments.

Keywords: Autonomous Robots · Adaptive Code Generation · Large Language Models · Artificial Intelligence.

1 Introduction

CAS are designed to operate under uncertainty, partial knowledge, and continuous environmental change. Rather than relying on a single centralized controller with a complete model of the world, CAS coordinates heterogeneous components whose collective behavior emerges through feedback, adaptation, and interaction with a dynamic environment [24,1]. Robotic systems operating outside static industrial settings constitute a particularly challenging instance of this paradigm. They must interpret high-level goals, perceive incomplete and changing environments, select appropriate actions, and revise their behavior when assumptions about the world become invalid.

J. Flerlage et al.

However, conventional robotic systems are typically designed for static and well-defined environments and tasks. The prevailing paradigms of conventional robotics have historically centered on low-level control, symbolic planning, and rule-based systems [13,20]. Within industrial environments, such as automotive assembly lines, robots execute predetermined operations based on a closed-world assumption, utilizing deterministic algorithms, fixed rule sets, and task models that are entirely specified in advance. Even in domains where Artificial Intelligence (AI) appears to provide greater flexibility, such as autonomous driving or industrial manipulation, system behavior remains constrained by predefined environmental assumptions [11,16]. A notable illustration of this is autonomous driving, wherein AI models are trained to recognize a specific set of object classes, such as pedestrians, traffic signs, and lane markings [11]. While such approaches are demonstrably effective within their intended domains, they remain inherently limited in scope due to their reliance on predefined taxonomies and fixed execution models. To provide an example, an autonomous car may navigate safely through a city, but it may fail to respond appropriately when a traffic officer overrides traffic signs or signals in a manner not represented in the vehicle's training data. Consequently, they are unable to generalize to dynamic and open-ended environments in which robots encounter novel objects, conditions, and unknown tasks [7].

This leads to the first challenge in the field of adaptive robotics, where robots are expected to operate in environments and task settings that cannot be fully specified at design time. Addressing this challenge requires a shift toward natural language as a versatile medium for task specification, enabling robots to interpret and execute a virtually limitless range of complex instructions that cannot be captured by rigid, predefined taxonomies. The inherent flexibility of natural language introduces a significant secondary challenge: such high-level intentions are frequently underspecified, leaving a wide semantic gap between a human's intent and the granular actions a robot must perform. To illustrate this point, one may consider a scenario in which a robot is assigned the intention of requesting a coffee. It is conceivable that such tasks could encompass the instruction of a robot to explore an unknown environment, inspect a room, search for relevant objects, operate a machine, and retrieve a requested coffee. However, this instruction does not include several key elements. Firstly, the text provides no indication as to which objects the robot is to encounter and how to react to them. Secondly, the text fails to specify which areas the robot should visit first. Thirdly, the text does not provide a definitive timeframe within which the exploration should be deemed complete. In conclusion, translating a simple human intention into a concrete operational plan remains a major hurdle, as the robot must autonomously infer the missing procedural details and environmental constraints.

Recent advances in generative AI offer a promising foundation for this type of intention-driven adaptation. LLMs have the capacity to interpret natural language instructions, infer task goals, generate action plans, and reason about task progress [6,2,17,18]. Nevertheless, intention-driven robotic control also ne-cessitates the grounding of these plans in the physical environment. To achieve this, VLMs provide a mechanism for deriving semantic descriptions from visual observations, enabling robots to reason about objects and spatial relations that extend beyond predefined categories [19]. The integration of generative AI into robotic control systems introduces a fundamental tension, as the properties that render generative models attractive for open-ended adaptation also render them difficult to integrate into reliable control loops. It is evident that both LLMs and VLMs possess a degree of flexibility that enables them to function on instructions that are underspecified and on incomplete scene information. However, it is important to acknowledge that the outputs of these systems are non-deterministic and not guaranteed to be correct. Furthermore, these outputs are based on continuously evolving representations of the environment. For CAS, this necessitates a framework where generative AI is embedded into an adaptive feedback architecture without compromising reliability. This challenge motivates the following research question:

How can generative AI be integrated into a Collective Adaptive System for robotic control such that user intentions can be translated into reliable robot behavior under uncertainty, incomplete knowledge, and continuous environmental change?

The question is addressed by means of an architectural framework for intention-driven robotic task execution in dynamic and unstructured environments. The architectural framework implements the MAPE-K feedback loop, meticulously decomposing the process of robotic adaptation into five distinct phases: monitoring, analysis, planning, execution, and knowledge management [4]. A VLM-based perception component is responsible for monitoring the environment and producing open-ended semantic descriptions of the robot's surroundings. A planning component, based on an LLM, is capable of interpreting user intentions and generating executable robot behavior. A library of robotic control functions constrains the LLM's output to valid actions, thereby enabling syntactic verification before execution. A workflow-monitoring and knowledge component maintains information about execution progress, previous actions, and observed scene changes, thereby supporting adaptation over long-running tasks.

Our architectural framework addresses three fundamental challenges in the domain of intention-driven adaptive robotics. Firstly, it mitigates the formalization gap between imprecise natural language intentions and the precise control structures required for robotic execution. Our framework employs an advanced LLM that translates user intentions into workflows. Secondly, it addresses the taxonomy gap that arises when robots encounter objects and situations that cannot be fully anticipated at design time. Rather than relying exclusively on a fixed object taxonomy, the VLM provides open-ended semantic grounding, which is stabilized over time through repeated observations. Thirdly, it addresses the temporal state problem of generative controllers by maintaining explicit execution state, thus allowing the system to distinguish between completed subtasks, failed actions, and pending objectives.

J. Flerlage et al.

In order to investigate the aforementioned research question, a proof-of-concept implementation of the proposed architecture for a quadruped robot performing exploration tasks is presented. The robot receives high-level user intentions rather than explicit programs and must autonomously generate, execute, and adapt task behavior in response to its environment. The system is evaluated across a range of object-identification and exploration tasks and scenarios, utilizing both finite and open-ended tasks. Furthermore, a range of LLMs are being benchmarked to ascertain how variations in generative models impact task success, robustness, replanning behavior, and termination control.

The following contributions are made by the paper:

  1. The present paper proposes a MAPE-K-inspired architectural framework for intention-driven robotic control in dynamic and unstructured environments.

  2. The integration of LLMs and VLMs into a constrained adaptive feedback loop that combines semantic grounding, executable code generation, monitoring, and persistent task knowledge is demonstrated.

  3. The performance of three state-of-the-art LLMs is evaluated as a fundamental component for intention-driven robotic control in dynamic and unstructured environments, utilizing exploration tasks that necessitate spatial and temporal reasoning, executable code generation, programming capabilities, and mathematical problem-solving.

In Section 2 the framework architecture is presented. While Section 3 describes the methods and implementation, Section 4 shows an evaluation. After Section 5 addresses the related work, Section 6 concludes our work.

References (26)