MEKAWIRE
ExpertarXiv

Teach, Abstract, Apply: A Framework for Dialogue-Driven Task Learning with Collaborative Robots

Chalamalasetti Kranti, Sherzod Hakimov, David Schlangen
From the abstract

Collaborative robots (cobots) are designed to be safer and more interactive than traditional industrial robots, share the same workspace as humans, and assist them in a range of shop-floor tasks such as palletization, joint assembly, and part inspection. Many of these tasks involve repetitive workflows that may evolve with changes in production environments and task specifications.

From the abstract. Our summary is in progress.

Full paper

Teach, Abstract, Apply: A Framework for Dialogue-Driven Task Learning with Collaborative Robots

Chalamalasetti Kranti, Sherzod Hakimov, David Schlangen

Published under CC BY-NC-SA 4.0. Reproduced with attribution; original at arXiv:2611.00297 (PDF).

\correspondance

\extraAuth

Abstract

Collaborative robots (cobots) are designed to be safer and more interactive than traditional industrial robots, share the same workspace as humans, and assist them in a range of shop-floor tasks such as palletization, joint assembly, and part inspection. Many of these tasks involve repetitive workflows that may evolve with changes in production environments and task specifications. These requirements motivate the need for intuitive interfaces that allow workers to modify workflows on the shop floor and generalise these routines for future use. This work introduces the Teach-Abstract-Apply (TAA) framework, which enables human operators to (a) teach new workflows to cobots in natural language, (b) abstract the taught workflows into skills for later use, and (c) apply these skills in different settings. As a case study, we apply the TAA framework to a collaborative structure-building task and evaluate it with both open-weight (Qwen3-Coder) and closed (GPT5.2-Codex) models in self-play and cross-model configurations. Our results show that skill abstraction improves task success rates and reduces interaction cost. Beyond automated evaluation, a preliminary human-in-the-loop study suggests that the pipeline also works with human instructions.

\helveticabold

1 Keywords:

collaborative dialogue systems, human-robot interaction, natural language dialogue, skill learning, skill reuse, program synthesis

†

2 Introduction

Industry 4.0 (Rüßmann et al., 2015; Xu et al., 2018) suggests a transformation from conventional automation to the use of smart machines and smart factories in manufacturing. Its vision includes collaborative robots (cobots) assisting human coworkers (Colgate et al., 1996) on factory floors to enhance productivity, flexibility and efficiency. Unlike traditional industrial robots, these cobots are designed with enhanced safety mechanisms (Wannasuphoprasit et al., 1997; Akella et al., 1999) and simplified programming requirements (Stopp et al., 2001; Estable et al., 2002) that enable them to work alongside human coworkers in the same workspace and reduce the need for expert robot programmers in operating them. However, real-world human-robot interaction is still far from achieving such seamless collaboration (Rodríguez-Guerra et al., 2021; Segura et al., 2025). Various research approaches (Andersen et al., 2016; Rosen et al., 2020; Schoen et al., 2022; White and Mutlu, 2024) have therefore focused on lowering the barriers to using cobot interfaces. With many industrial robots deployed on assembly floors, it is important to enable effective collaboration (Aaltonen and Salmi, 2019; Sullivan et al., 2024) between humans and robots.

Recently, human-robot collaboration workflows have been improved by advancements in large language models (LLMs) (Zhang et al., 2023; Kim et al., 2024), with a focus on immediate, specific actions for “here and now” scenarios (Driess et al., 2023). These workflows usually operate by taking commands from users (Ichter et al., 2022), with the backend LLM analysing and reasoning about them (Liang et al., 2023), preparing a step-by-step plan (Huang et al., 2022; Wang et al., 2024) that considers the current environment, and generating a program (Singh et al., 2023) to perform the task. However, these methods focus primarily on executing the current task rather than retaining and reusing these behaviors, which is the core intent of teaching custom behaviors to the robot. Furthermore, in industrial environments, it is useful to teach a task as well as to capture the behavior so it can be re-deployed in new settings with minimal user intervention (Bauer et al., 2016; Villani et al., 2018; Robots, 2024; Sullivan et al., 2024). Without a mechanism to generalize and reuse learned behaviors, robots must be re-taught or re-programmed each time the environment changes, limiting scalability.

Teaching is often iterative, involving back-and-forth clarifications (Padmakumar et al., 2022) and corrections that lead to incremental refinement (Chiyah-Garcia et al., 2024). Prior work on conversational programming (Désilets, 2001; Rahit et al., 2019) addresses parts of this process by enabling programs to be iteratively specified and refined through dialogue (Cypher and Halbert, 1993). Building on this, we propose the “TAA: Teach, Abstract, Apply” framework that enables workers to talk to a robot in natural language (Lauria et al., 2002; Gorostiza and Salichs, 2011), iteratively refine the workflow (Thomason et al., 2019), and thereby teach new behaviors through a multi-turn dialogue (Ge et al., 2024). As the name suggests, the TAA framework consists of three stages: Teach, Abstract, and Apply. Teach refers to the process of a worker engaging in a multi-turn interaction with the robot, with the robot extracting relevant information from the interaction. Abstract refers to the process of capturing and generalising the extracted information into a behavior that can be applied across different environments. Apply refers to the process of applying these learned behaviors in different settings with minimal user intervention.

Figure 1: Overview of the Teach and Abstract steps represented through the structure building task in a simulated environment. Teach: the worker uses natural-language to teach the Cobot an assembly arrangement; Abstract: successful interaction traces are abstracted into a reusable skill.
Figure 2: Overview of the Apply step represented through the structure-building task in a simulated environment. Reuse: refers to using an existing skill at a new location; Repeat: refers to using an existing skill with new properties — the washer color is set to ‘green’ and the skill is repeated across a set of locations in a pattern.

We test the TAA framework in a controlled setting through a collaborative structure-building task (see Figure 1) inspired by real-world industrial assembly scenarios, in which a worker converses with the robot to build a structure in a grid-based environment. These structures are composed of components such as washers, nuts, screws, and bridges. During the Teach step, the worker communicates the structure to be built in natural language in a step-by-step fashion, and the robot semantically translates these instructions into executable code. The outcome of the Teach step is an interaction trace consisting of a set of instruction-action pairs, which are then used by the Abstract step to capture and generalise the code into a persistent function that can be adapted to different environments. The Apply step focuses on evaluating how well the robot can reuse these persistent functions in different settings without requiring the worker to teach it again from scratch. To isolate the effectiveness of this framework, the task is evaluated in a controlled environment without a physical robot. An instruction-tuned Code LLM generates executable code snippets for robot manipulation, which are executed in a virtual simulator, thereby for now avoiding the perception and control issues of a real robot.

With this controlled task setting, we investigate the following research questions: (R1) Can LLM-based interpretation together with a dialogue management framework realise acquisition of executable behaviours through multi-turn natural-language dialogue? (R2) Can LLM-based interpretation be used to abstract from the concrete teaching situation a function that generalises to new spatial contexts and reused without re-specification? (R3) Can learned behaviors improve task success and reduce interaction cost compared to teaching from scratch? Our contributions are threefold: (1) we present TAA, a dialogue-based framework for teaching new behaviors grounded in executable programs; (2) we introduce a behavior abstraction mechanism that generalises demonstrated behaviors into reusable functions; and (3) we provide a comprehensive evaluation, including reconstruction, reuse, and repeat experiments, along with a pilot human study, demonstrating that learned behaviors enable persistent reuse, reduce interaction cost, and improve task performance compared to context-only conversational programming.

3 Related Work

To make cobots more accessible and make full use of their collaborative potential (Tsarouchi et al., 2016; El Zaatari et al., 2019; Zhang et al., 2023), prior work has introduced a variety of interfaces, including text-based (Karli et al., 2024), voice-based (Ionescu and Schlund, 2023), visual (Kuhail et al., 2021; Schoen et al., 2022), multi-modal (Beschi et al., 2019; Fogli et al., 2022; Lai et al., 2026), and kinesthetic teaching (Ajaykumar et al., 2021b) interfaces. However, these interfaces primarily support interaction for the current task. Our work extends such interactions to generate persistent representations that can be reused in later tasks.

3.1 Collaborative Dialogue Systems

Human-robot collaboration systems have evolved from instruction-only style (Lauria et al., 2002) to interactive style (Foster et al., 2006; Gorostiza and Salichs, 2011) that showcases the necessity of back-and-forth negotiation. Chai et al. (2016); Chai et al. (2018) discuss the inherently ambiguous nature of human instructions, which motivates the need for correction and clarification as core interaction patterns (Thomason et al., 2019; Kane et al., 2022; Chiyah-Garcia et al., 2024), the robot must actively seek and incorporate feedback across turns. More recently Bonial et al. (2024) explores establishing common ground across different modalities of information in human-robot dialogue. Although these systems advance collaborative interaction, the knowledge learned through dialogue is not retained as an executable representation. Our work builds on these systems by extracting and persisting learned knowledge as reusable executable behaviors.

3.2 Conversational Programming

Prior work (Heidorn, 1976; Leggett and Williams, 1984; Désilets, 2001) proposed using different modalities for translating natural language instructions into programs. With recent advancements in LLMs, program synthesis has become widely explored (Chen et al., 2021; Austin et al., 2021; Hou et al., 2024). Nijkamp et al. (2023) explore multi-turn interactions for improving overall program synthesis quality. Several works (Huang et al., 2022; Ichter et al., 2022; Liang et al., 2023; Singh et al., 2023; Töberg and Cimiano, 2023; Macaluso et al., 2024; Kim et al., 2026) extend these ideas to generate executable robot tasks and plans from natural language instructions. However, these works focus primarily on context-bound execution and often assume users with programming knowledge. Our work instead targets factory workers, who may lack programming background but have domain expertise (Aaltonen and Salmi, 2019; Bauer et al., 2016; Villani et al., 2018; Sullivan et al., 2024). Furthermore, the outcome of the dialogue is captured as a persistent, reusable skill representation in the form of an executable program.

3.3 Reusable Skills

Once deployed in the real world, collaborative robot routines evolve over time, which traditionally involves re-programming (Lozano-Perez, 1983; Biggs et al., 2003; Villani et al., 2018; Ajaykumar et al., 2021a; Giberti et al., 2022). To reduce this burden, Konidaris et al. (2012) proposed segmenting demonstrations into reusable skill trees that allow users to build new sets of skills. Lioutikov et al. (2017) learn a library of movement primitives using probabilistic methods. Although these approaches aim to discover reusable primitives from demonstrations, they still depend on physical robot access and predefined model structures and representations. Leveraging recent LLM progress, several works use them to generate robot programs (Mu et al., 2024; Hu et al., 2024). Wang et al. (2024) demonstrate building a skill library that allows reusing learned skills; however, the stored skills are specialized rather than generalized. Tziafas and Kasaei (2024) extend this to generalizable skills in lifelong learning. Moreover, recent advances in coding agents have introduced user-editable skills in text files with recipes for task development. This has led to the evolution of an open-standard (SKILL.md 1) file that describes a skill and its associated tools and workflows. Similar ideas have been explored in robotics, to generate, refine and reuse robotic behaviors (Lu et al., 2026; Hu et al., 2026; Fu et al., 2026). While TAA shares the idea of maintaining persistent skills with these works, it differs in how these skills are systematically evaluated across different application settings through reuse and repeat tasks. This is a necessary assessment because the goal is not only to acquire a skill through teaching, but also to redeploy it in new settings.

Taken together, these lines of research establish the building blocks for TAA. Collaborative dialogue systems demonstrate the usefulness of multi-turn interaction for clarifying and grounding user intent, but they do not retain what is learned. Conversational programming shows how natural-language interactions can be used to iteratively specify and refine executable programs, but primarily focuses on generating programs for the current task. Works on skill reuse demonstrate the value of persistent, reusable robot behaviors, but does not evaluate how these skills transfer under systematic task modifications. TAA brings them together by enabling users to teach robots new behaviors through multi-turn dialogue, abstracting the interaction into persistent executable skills, and evaluating their reuse across systematic task modifications.

4 Methodology

4.1 TAA: Teach, Abstract, Apply

Building on human–robot collaborative dialogue systems (Foster et al., 2006; Gorostiza and Salichs, 2011; Giberti et al., 2022; Kane et al., 2022; Bonial et al., 2024), we formulate the Teach-Abstract-Apply (TAA) framework as three distinct and sequential steps: Teach, Abstract, and Apply, where the outcome of each preceding step provides input to the next step.

The Teach step begins with a goal that is known only to the worker and may be represented in different forms, such as an image (e.g., a schematic diagram), text (e.g., a design document), voice note (e.g., a description of the required functionality), or a combination of one or more of these modalities. The worker interacts with the robot in natural language and incrementally guides the robot towards the goal. The interactions usually span multiple turns and include clarifications, corrections and acknowledgments from both the worker and the robot. We frame this interaction as a programming process which is refined iteratively. The outcome of the Teach step is an interaction trace that encodes the workflow. This is followed by the Abstract step, which generates a persistent representation of the workflow. Necessary information from the interaction trace is extracted and generalised so that the retained representation can be extended to different environments. The outcome of the Abstract step is a skill (e.g., a program, a .md file etc.) that is available for later use. And the Apply step follows, which applies the skills from the previous step in new settings. The robot is equipped with these new skills and the evaluation focuses on whether the skills can be adapted and applied to the new settings (e.g., changing the attributes in a workflow, repeating the workflow in different patterns, or building a new workflow using the current workflow etc.) without teaching from scratch.

4.2 Structure Building Task

Kranti et al. (2024) proposed a structure-building task (SARTCo) in which an instruction giver (Programmer) collaborates with an instruction follower (Cobot) to reconstruct a goal structure, which consists of different industrial-assembly-style configurations. The Programmer receives the goal structure, represented on a 8\times 8, 2.5D 2 grid, and instructs the Cobot in natural language on how to reconstruct it. The grid is represented as a Python array, and each grid cell can be accessed using its row and column values, e.g., [1,2] or [3,4]. The Cobot translates the instructions into code snippets, which, when executed in a simulator, generate the resulting structure on the grid. They explore generating first-order (primitive code) and higher-order (abstract programs) programs from single-turn instructions. We use this dataset for our experiments.

4.3 Realising TAA Framework

Our objective is to enable workers to teach robots persistent workflow representations through natural language using TAA. For this purpose, we instantiate TAA through the structure building task in a controlled setting. We use instruction-tuned Code LLMs as both the Programmer and the Cobot. The LLM powering the Programmer receives the goal structure in textual form and instructs the Cobot in natural language. The Cobot receives Programmer’s instruction along with the current state of the reconstructed board in textual form and generates code snippets. These code snippets are executed in the simulator, and the resulting structure is returned to the Programmer in textual form as a follow-up response. We use the clem:todd framework (Kranti et al., 2025) to facilitate these interactions which follow a specific JSON schema (e.g., code, clarification, acknowledgment). At the end of the interaction, the resulting instruction-code pairs are used to generate a higher-order Python function that is saved as a skill. These saved skills are evaluated for their extendability to new tasks. As mentioned in Section 2, we do not use a physical robot in this controlled evaluation.

4.3.1 Teach: Teaching through Dialogue

A conversation demonstration (see Figure 3) refers to an incremental teaching process through which the worker teaches the cobot new manipulation routines for building a given goal structure (also referred as a board). The Programmer may be a human, LLM, or rule-based generator, while the Cobot may be a human or LLM, are treated as the two players in the structure building task, and the Game Master (GM) coordinates the turn-level interaction between them. The task concludes when Programmer responds with DONE, or when the maximum turn limit (15) is reached.

Figure 3: An example interaction trace showing how the conversation proceeds. At Turn 1, the Programmer instructs the Cobot to place a red screw on top of a yellow washer at position [1,3]. However, the Cobot responds with an action that places only a washer and also uses the wrong color. The Programmer corrects the color and proceeds with the next step. At Turn 3, the Cobot asks for clarification about the screw color, although it was already specified in Turn 1. In the next turn, the Programmer repeats the details. The shared context shows how the reconstructed board is updated after each Cobot action. When the Programmer responds with DONE, the interaction is completed.
4.3.1.1 Programmer: Instruction Giver

In line with existing work (Chalamalasetti et al., 2023; Kazi et al., 2024), we use LLMs to simulate instructors. We conducted multiple ablation studies to design the final prompt structure (details in Section 5.2). Programmer is prompted 3 in a zero-shot setting with information about the environment, the task constraints, and the goal board to reconstruct. The goal board is represented in textual format for a text-based LLM and describes the stacking order and cell-level details, including the occupied elements and their colors. Based on the ablation studies, the prompt included a difference board, that shows the difference between the goal board and the current reconstruction board for each cell and stacking level. In the first turn, the difference board is None; in subsequent turns, it is updated with the relevant differences.

When instructions are ambiguous or incomplete, Cobot requests clarification, and Programmer elaborates or corrects the description. If Cobot makes an error, such as placing unintended shapes in the grid, colors, or spatial positions, Programmer provides corrective feedback so that subsequent outputs align with the intended goal. Through this iterative process, Programmer and Cobot collaboratively reconstruct the goal board.

4.3.1.2 Cobot: Instruction Follower

Cobot translates user instructions into executable code. We use instruction-tuned code LLMs for this purpose. Cobot is prompted with information about the environment, the task constraints, and the current state of the reconstruction board. Similar to Programmer, the current reconstruction board is represented in textual format, describing the stacking order and cell-level details, including the occupied elements and their colors.

For a given input instruction, Cobot is expected to either produce the corresponding action sequence (e.g.,, input: “place a red washer in cell 4,3”; output: put(board, ‘washer’, ‘red’, x=4, y=3)) or ask for clarification (e.g.,, “there is already a nut present in the same location. do I need to remove the nut before placing a washer or stack on it?”). The generated action sequences are executed in a virtual simulator. If execution fails, Cobot receives feedback about the error and either corrects the code or asks for clarification when the error cannot be resolved without additional context from Programmer. If execution continues to fail after three attempts, the interaction is terminated and the test instance is treated as a failure. Cobot can also acknowledge Programmer queries (e.g.,, input: “do you know how to place a washer?”; output: “Yes, I know!”).

4.3.1.3 Game Master: Interaction Coordinator

The Game Master (GM) manages the turn-level interaction between Programmer and Cobot. At the beginning of each turn, GM provides Programmer with the goal board and the difference board. Programmer then gives a natural language instruction to guide the reconstruction, and Cobot responds by translating the instruction into executable Python code, asking for clarification, or providing an acknowledgment when appropriate. GM validates each player response to ensure that it follows the required format; if a response does not satisfy the format requirements, the interaction is aborted. GM also executes Cobot’s generated code in the virtual simulator and shares the updated reconstruction board with both players in the subsequent turn. When execution fails, GM forwards the error to Cobot, which can revise the code or ask Programmer for clarification. The interaction continues until Programmer responds with DONE, the maximum turn limit (15) is reached, or execution fails after three attempts. Once Programmer responds with DONE, GM evaluates task success by comparing the reconstructed board with the goal board at each cell location, including component color and stacking order. If the reconstruction is successful, GM forwards the instruction-code pairs, consisting of each Programmer instruction and its corresponding Cobot-generated action, to the Optimizer module for further processing. The prompt structure, number of execution retries, and overall task interaction are based on the ablation studies, discussed in Section 5.2.

4.3.2 Abstract (Optimizer): Generalisable Function Generator

Only successful reconstruction interactions are used for optimization, since they correspond to cases where the goal board was reconstructed correctly. Unsuccessful or incorrect interactions are excluded. Optimizer receives the sequence of instruction-response pairs collected during reconstruction, where each Programmer instruction is paired with the corresponding Cobot-generated action as shown in Figure 4.

Figure 4: Overview of reusable function generation. Given the instruction-response pairs and a predefined function signature, the Code LLM abstracts the primitive code snippets into a reusable higher-order function. The generated function is then evaluated by comparing the structure it reconstructs with the structure produced by the input code snippets, evaluating each cell for component type, color, and stacking level.

The Cobot output contains primitive placement sequences and may also reflect clarifications or corrections made during the interaction. Although these sequences are sufficient to reconstruct the goal board, they cannot be reused in later tasks unless they are converted into a reusable representation. We therefore abstract recurring action patterns into higher-order Python functions that produce the same goal board state as the primitive code sequences.

Optimizing code into reusable abstractions is often time-consuming and requires human expertise. Prior work (Yang et al., 2023; Tapia et al., 2025; Cynthia, 2025) has shown that LLMs can support optimization processes. Building on this, we follow a similar LLM-as-optimizer paradigm and use an instruction-tuned code LLM to iteratively transform the generated code into a reusable skill function. The optimizer is queried in a zero-shot setting with a prompt that includes information about the environment, task constraints, and instruction-response pairs from the reconstruction task. The output is a Python function, referred to as a skill, that encapsulates the manipulation routine in a reusable form for subsequent tasks.

The optimizer receives the full sequence of instruction-response pairs without pre-processing (see Figure 4). Since the sequence may include instructions that correct or clarify earlier ones, the optimizer is prompted to read the entire interaction, identify which code reflects the final intended actions, and discard any code that was later replaced or fixed. For example, an instruction may place a washer using put(board, ‘washer’, ‘red’, x=1, y=3). If a later instruction corrects the washer color to yellow with put(board, ‘washer’, ‘yellow’, x=1, y=3). The final code used for optimization would therefore include only put(board, ‘washer’, ‘yellow’, x=1, y=3). The prompt also instructs the optimizer to follow a predefined function signature. For illustration, a generated skill may be defined as def <object_name>(board, colors, x, y) and be used as ws(board, [‘yellow’, ‘red’], 1, 3). The generated function can then be stored and reused in subsequent tasks (Sections 4.3.3.1 and 4.3.3.2).

For a given input, Optimizer is expected to generate a Python function that produces the same board state as the input primitive code sequences when executed in the virtual simulator. Equivalence is determined by comparing the final board states produced by the generated function and the primitive code sequences. If the Optimizer output fails to execute, it receives feedback about the error and can revise the code. If it cannot correct the error within three attempts, the task is aborted and the test instance is treated as a failure. The task is considered successful when the Optimizer output replicates the board state and is considered failed when the maximum turn limit (10) is reached.

4.3.3 Apply
4.3.3.1 Reuse: Systematic Evaluation of Skill Generalisability

Once cobots are deployed in the real world, onsite requirements may differ from their pre-programmed routines due to customization needs or changing task constraints. These changes can include a new product variant, a change in assembly geometry, such as a V-shape instead of a T-shape, or an added inspection step, such as checking alignment before fastening. Adapting to such changes often requires a programming expert (Ajaykumar et al., 2021a; Giberti et al., 2022) or the use of complex interfaces (Akkaladevi et al., 2019; Dmytriyev et al., 2022; George et al., 2023; Ayalew et al., 2025), which can be costly (Barravecchia et al., 2023) and slow (Ajaykumar et al., 2021a).

We design the reuse task to study whether skills generated by the Optimizer can be adapted under controlled modifications. Specifically, we evaluate changes in color and spatial information, reflecting incremental adjustments common in assembly workflows. We are interested in: (a) can the model identify the required skill from the list of available skills? and (b) can the model use the selected skill with the correct modifications for the new requirement?

Similar to reconstruction, the reuse task consists of two players, Programmer and Cobot, interacting over a multi-turn dialogue to replicate a goal board. The skills generated by the Optimizer are made available in Cobot’s context. Each skill is represented by its function signature and a single-line description of the object it builds. Programmer is prompted to ask whether Cobot is aware of the relevant skill before guiding it to build the modified object using the available skills. Cobot is expected to identify the relevant skill from its context and generate a function call with the correct arguments. This function call is executed in the virtual simulator using the corresponding skill definition learned during optimization. If the corresponding skill is not available in the library, we use the ground truth function definition to execute the function call.

If Cobot cannot identify a suitable skill, Programmer provides step-by-step instructions, and the interaction falls back to the Teach reconstruction loop. The task is completed when Programmer signals completion or when the maximum turn limit (15) is reached. Once Programmer responds with DONE, GM evaluates task success by comparing the reconstructed board with the goal board at each cell location, including component color and stacking order.

4.3.3.2 Repeat: Systematic Evaluation of Repeated Skill Use

As robots are often used for repetitive tasks, we extend our study to examine how learned skills generalize to goal boards with repeated spatial patterns. The repeat task consists of goal boards where a single object is repeated across the grid in different patterns. Similar to the reuse task 4.3.3.1, the objects used in the goal boards are modified versions of the skills generated by the Optimizer. In the repeat task, these objects are placed multiple times across the board in structured patterns, requiring the models to recognize and generalize the repetition. We are interested in: (a) whether the models can identify the correct repetition pattern, including spatial arrangement, order, and frequency, to accurately replicate it; and (b) whether the models can express this pattern using appropriate programming abstractions, such as loops or nested loops.

The repeat task follows the same two-player, multi-turn interaction as the reuse task. Cobot is equipped with the learned skill set and is expected to select the relevant skill, generate the corresponding function calls, and use suitable programming abstractions to place the object repeatedly across the grid. If Cobot cannot identify a suitable skill, Programmer provides step-by-step instructions, and the interaction falls back to the Teach reconstruction loop. The task is completed when Programmer responds with DONE or when the maximum turn limit (30) is reached. Once Programmer responds with DONE, GM evaluates task success by comparing the reconstructed board with the goal board at each cell location, including component color and stacking order.

5 Experimental Setup

As the TAA framework follows two-player interaction, both players are prompted in a zero-shot setting and receive the full interaction history at every turn. More details about the prompt context are available in the Supplementary Material.

5.1 Dataset

To evaluate the proposed approach, we require an environment that mimics a manipulation setting and allows collaboration over multiple turns. The tasks also require semantic representations expressed in code so that outputs can be evaluated objectively. We use the SARTCo (Kranti et al., 2024) dataset for our experiments. The SARTCo dataset is an 8\times8 2.5D (a two-dimensional grid with vertical stacking) grid-world environment in which objects are arrangements of connected components of nuts, washers, screws, and bridges. A grid containing one or more such objects is referred to as a board. For the reconstruction and reuse tasks, the goal boards contain single objects, whereas the repeat task uses goal boards with multiple objects. Since the publicly released dataset contains a limited number of test samples (130), we generated a new set of samples using the same framework, producing a training set of 165 samples and validation and test sets of 495 samples each. The training set is used in the reconstruction task for teaching the skills. The validation and test sets contain three instances (that differ in colors and locations) for each of the 165 unique skills in the training set without any overlap. This setup is designed to evaluate whether the learned skills can generalize to unseen variations.

5.2 Ablation Studies

We conducted multiple ablation studies to design the prompt. This required several design decisions, including the number of turns before stopping the interaction, whether the cobot should ask clarification questions, whether execution error feedback improves reconstruction and overall success, and the number of turns allowed for the optimization step. Together, these decisions determine our final configuration. The detailed ablation results are available in the supplementary material.

5.3 Evaluation with a Human Programmer

To evaluate the performance of the proposed pipeline under natural human instructions, we conducted a preliminary human-in-the-loop evaluation on a subset of the test set. We randomly selected 50 test instances (seed = 76) and employed a human participant as the Programmer, while the Cobot was evaluated on the reuse and repeat tasks. In these experiments, the Cobot was powered by Qwen3-Coder using the skill-set generated by Qwen3-Coder. The participant was a student assistant in the department who was familiar with the experimental setup but had not worked on this paper.

5.4 Model Selection

We experiment with both an open-weight model (Qwen3 Coder 30B A3B Instruct 4) and a closed model (GPT5.2-Codex 5). These models were chosen based on their competitive performance on code generation benchmarks, representing both open-weight and closed model paradigms. We also investigate whether our approach can be realised with an open-weight model that can potentially be self-hosted and has latency advantages, by comparing it to a proprietary model that incurs usage-based costs. Hence as a case-study, we evaluate one model from each paradigm. The experiments include using the same model for both the Programmer and the Cobot, as well as cross-model pairings (using GPT5.2-Codex as the Programmer and Qwen3-Coder as the Cobot, and vice versa). The rationale for the cross-model pairings is to understand the sensitivity of the Cobot to the choice of the Programmer and its impact on task success. The open-weight model is hosted locally on a single A100 GPU and is accessed through a local API endpoint. The closed model is accessed via Azure APIs. Both models are run with a temperature of 0 to reduce output variance, with a max_new_tokens limit of 1000 for reconstruction and reuse tasks and 2000 for the repeat task.

5.5 Evaluation Metrics

As the dataset provides a known target configuration along with its semantic representation, we conduct a detailed evaluation of the model responses.

Reconstruction task: We use execution success to compare the reconstructed board state with the goal board in terms of the occupied cells (element type, color, location, and stacking order). In addition, we compute dialogue-level metrics, including success rate and clarification and correction rates normalized by the number of elements in the object, and the number of turns required to complete the reconstruction.

Optimization task: We use execution success to compare the board state produced by the generated optimized function with the goal board in terms of the occupied cells, measuring optimization accuracy. We also compute several structural metrics using Python’s abstract syntax tree (AST), including whether the generated code contains a valid function definition, the reduction in put calls relative to the input, and the presence of loops indicating abstraction rather than repetition. We further measure the bytecode length before and after optimization using Python’s dis module to assess structural compression.

Reuse and Repeat tasks: For the reuse and repeat tasks, we use execution success to compare the generated board with the ground truth board in terms of the occupied cells (element type, color, location, and order), measuring task accuracy when using learned skills. In addition, we measure the rate at which the model selects the correct function from the available skill set and the rate at which it applies this function with the correct arguments. We also compute the token-based cost for both No-skills and Skills-Used settings across self-play and cross-model pairings, analysing the trade-off between task success and computational cost.

6 Results

We present our results based on the research questions presented in Section 2, covering the talk–teach interaction, skill generation through optimization, and the reuse, repeat of learned skills in new contexts, providing both quantitative and qualitative analysis.

Table 1: Performance comparison between Qwen3-Coder and GPT5.2-Codex on reconstruction and optimization tasks, reporting success rates for each component and overall performance along with token cost; Overall = Reconstruction x Optimization success; Token cost is the total across all test instances.
  • Reconstruction
    Success Rate
    Optimization
    Overall
  • Qwen3-Coder
    Success Rate
    0.69
    0.93
    0.64
    Token Cost ($)
    1.41
  • GPT5.2-Codex
    Success Rate
    0.93
    1.00
    0.93
    Token Cost ($)
    10.43

6.1 Reconstruction Task

Can we through this methodology teach new behaviors through multi-turn natural language dialogue? This question examines the teach stage of the TAA pipeline, where the Cobot learns to reconstruct a goal board through multi-turn dialogue with the Programmer.

Table 1 shows the success rate of teaching new skills. We first compute the reconstruction success rate, where the Programmer collaborates with the Cobot to accurately reconstruct the board while generating the primitive code snippets. The results show that reconstruction success is higher for the closed model (GPT5.2-Codex) than for the open-weight model (Qwen3-Coder). Some of the failures in Qwen3-Coder are due to the model repeatedly responding with ‘‘Yes, I know’’ without generating code snippets, or continuing to ask clarification questions without correcting misplacements caused by using the wrong colors or incorrect locations. Although reconstruction success varies between the models, both models show higher optimization success rates for successful reconstructions. The token cost is computed based on the number of tokens used and pricing information from OpenRouter6, and is reported for reference only7 as pricing is subject to change by API providers.

Figure 5: Performance of Qwen3-Coder and GPT5.2-Codex as task complexity increases (measured by the number of elements per object). The plots show average number of clarification and correction turns, and overall success rate for reconstruction task with varying structural complexity.

These results indicate that it is possible to acquire new executable behaviors through the proposed framework, and that the success rate depends on the model’s capabilities. We now examine the performance drops through the lens of object complexity and how it affects interaction behavior and reconstruction success. Specifically, we analyze how the success rate changes with the number of elements in the object, and whether clarification and correction rates change with increasing object complexity. Figure 5 shows that for Qwen3-Coder, clarifications and corrections appear to increase with the number of elements. In contrast, GPT5.2-Codex shows an almost flat trend in clarifications and only a few instances of corrections for objects with four elements, while all other cases show zero corrections. For both models, the reconstruction success rate declines as the number of elements in the object increases. The drop is higher for Qwen3-Coder, whereas GPT5.2-Codex appears less affected, although a slight decrease is still observed.

6.1.1 Abstract: Reusable Function Generation

After a successful Teach step, we now proceed with the Abstract step, to abstract the primitive action sequences. We evaluate how accurately models can abstract the given code snippets into a higher-order function.

Figure 6: Success rate of Qwen3-Coder and GPT5.2-Codex on code optimization objectives. Each point represents the proportion of test instances where the model correctly applied the required transformation, including using correct function names, using loop constructs, reducing put() calls, and minimizing output byte length; Vertical lines connect the two models scores to highlight the gap.

Table 1 shows that both the models achieve higher optimization rates. That indicates the abstracted functions reproduce the behavior of the input primitive sequences. We next analyse how well these functions are structurally optimized. This question is important as the goal is not only successful reconstruction but also generating a function that is both optimized and reusable, capable of reproducing the learned behavior in new contexts. Figure 6 shows the analysis across model configurations.

We first check whether the output contains a valid function definition with the correct object name. We then examine how the primitive sequences are structured within the generated function. As the input consists of multiple put() calls, recurring patterns may be present, and an effective optimizer should abstract such patterns. We therefore evaluate whether a loop is present in the generated output and whether the overall number of put() calls is reduced, since loop alone does not guarantee correct abstraction. Finally, we compute whether the bytecode length is reduced after optimization. Both models consistently generate the correct function signature. GPT5.2-Codex effectively uses loops and reduces the number of put() calls, while Qwen3-Coder shows competitive performance on both metrics. However, neither model shows a significant reduction in bytecode length, although GPT5.2-Codex performs slightly better. This is because Python’s loop constructs and data structures such as list definitions, zip, and tuple unpacking introduce compilation overhead that can offset or exceed the savings from fewer put() calls. Overall, this shows that the optimizer able to abstract the code that is not only functionally correct but also structurally optimized.

Taken together, the results suggest that Teach and Abstract steps enable the acquisition of new executable behaviors through multi-turn natural-language dialogue and their abstraction into reusable skills. The generalisability of these abstracted skills is further evaluated through the reuse and repeat tasks.

6.2 Reuse

With the generation of reusable skills, the next step is to evaluate whether these skills can be applied in new scenarios. We evaluate three settings: the test set without any skills (no-skills), which effectively reduces the reuse task to a reconstruction-style test and acts as the baseline; the test set using the skill set learned by Qwen3-Coder (Qwen skills); and finally using the skill set learned by GPT5.2-Codex (Codex skills). This allows us to study the impact of having learned skills on overall task success and associated cost. We additionally evaluate cross-pairings of the models to examine whether the choice of Programmer (instruction giver) influences the Cobot (instruction follower) model. In cases where a corresponding skill is unavailable, as not all reconstruction instances are successful, these instances fall back to the reconstruction-style task.

Figure 7: Cost–performance trade-off for the reuse task. Each point represents a model configuration, comparing success rate and token cost when responses are generated without skills, with Qwen skills, or with Codex skills; G-Q, Q-Q etc. Labels denote Programmer–Cobot pairs; G-Q: GPT as Programmer and Qwen as Cobot; Q-G: Qwen as Programmer and GPT as Cobot; The y-axis is truncated to the range 0.6-1.0 to highlight differences among performance scores.

Impact of Skill Usage: As shown in Figure 7, using learned skill sets improves task success compared to the no-skill baseline. For the Qwen3-Coder Cobot using the same model as programmer (Q–Q), the success rate increases from 0.72 without skills to 0.86 when using the Qwen3-Coder skill set and to 0.87 when using the GPT5.2-Codex skill set. When the programmer is changed to GPT5.2-Codex (G–Q), the success rate increases to 0.99 for both skill sets (Qwen3 skills: 0.99; Codex skills: 0.99). We further observe that using skill sets reduces overall token cost compared to the no-skill baseline. Without skills, the cost is $3.63 for Q–Q and $7.96 for G–Q. With skill reuse, the cost becomes $2.64 for Q–Q and $4.88 for G–Q when using Qwen3 skills, and $2.92 for Q–Q and $4.96 for G–Q when using Codex skills.

While the Qwen3-Coder Cobot shows a larger improvement in success rate with the use of skills (Q–Q), the GPT5.2-Codex Cobot (G–G) shows a smaller increase, though with a more substantial cost reduction. For GPT5.2-Codex, the success rate increases from 0.93 without skills to 0.97 when using the Qwen3 skill set and to 0.99 when using the Codex skill set. The reduction in cost is larger, decreasing from $31.44 without skills to $28.82 with the Qwen3 skill set and to $20.44 with the Codex skill set. A similar trend is observed for the cross-pairing setting (Q–G), where the GPT5.2-Codex Cobot benefits less from cross-pairing, with the success rate decreasing and cost remaining higher. In particular, the cost reaches $54.62 in the no-skill setting compared to $31.44 for G–G. This behavior is largely due to ambiguous instructions that trigger additional clarification questions, resulting in longer interactions, increased token usage, and slightly lower reconstruction success.

These results demonstrate that skills generated during the reconstruction task are model-agnostic and can be reused by cobots powered by different models for subsequent tasks resulting in improved success rates and reduced costs. We next evaluate the applicability of these reusable skills in the Repeat test.

6.3 Repeat

Similar to the reuse task evaluation, the repeat task examines whether the models can use learned skills to reconstruct boards that contain repeated placements of the same object across the grid. The experiments consider three settings: (a) no-skills, where the models perform the task without access to any learned skills; (b) Qwen3-Coder skills, a skill set learned by the Qwen3-Coder Cobot; and (c) GPT5.2-Codex skills, a skill set learned by the GPT5.2-Codex Cobot. The models are evaluated in both self-play and cross-pairing settings.

Impact of Skill Usage: As shown in Figure 8, the repeat task also shows benefits from the use of learned skills for the Qwen3-Coder Cobot. In self-play, the success rate increases from 0.46 without skills to 0.73 and 0.70 when using the Qwen3-Coder and GPT5.2-Codex skill sets respectively, while the cost is reduced from $28.37 to $11.84 and $12.70. When cross-paired with GPT5.2-Codex as the Programmer, the success rate increases from 0.89 to 0.93 for both skill sets, while the cost decreases from $67.40 to $27.68 and $23.65. The higher cost in the repeat task compared to other tasks is due to repeated placements of the same object, which lead to multiple instructions, clarification requests, or corrections, and therefore increased token usage.

Figure 8: Trade-off between token cost and repeat task success rate across model configurations. Results compare responses generated without skills, with Qwen skills, and with Codex skills, showing that skill usage significantly improves success rates while maintaining relatively low token cost; The y-axis is truncated to the range 0.4-1.0 to highlight differences among performance scores.

In contrast, the GPT5.2-Codex Cobot shows similar success rates across the no-skill and skill settings. The success rate changes from 0.98 without skills to 0.97 with the Qwen3-Coder skill set and 0.99 with the GPT5.2-Codex skill set, while the cost decreases from $40.67 to $28.89 and $19.90 respectively. The decrease in success rate in the cross-pairing case is due to ambiguous instructions, similar to the reuse scenarios. This effect is more in the repeat task compared to the reuse task because the reuse task involves a single object placement, whereas the repeat task requires placing the same object multiple times on the grid.

Together, the Reuse and Repeat evaluations show that the skills learned from Teach and Abstract steps can be Applied to new contexts across different model configurations. The learned skills are transferable across models, can improve task performance, and reduce the associated costs.

6.4 Skill Retrieval Analysis

Sections 6.2 and 6.3 show that skill usage improves the overall task performance, we next analyse how much skill use contributed to success and how much success comes from the fallback reconstruction flow.

Table 2: Skill retrieval rate across model configurations for Reuse and Repeat tasks. The highlighted values indicate the higher-performing configuration when using the corresponding skill set. Labels denote Programmer–Cobot pairs; G-Q: GPT as Programmer and Qwen as Cobot; Q-G: Qwen as Programmer and GPT as Cobot; OTSR: Overall Task Success Rate; SRSR: Skill-retrieval Success Rate; FRSR: Fall-back Reconstruction Success Rate.
  • Reuse
    Skill-Set
    Qwen
    Model
    Q-Q
    OTSR
    0.865
    SRSR (%)
    83.64
    FRSR (%)
    16.35
  • G-Q
    Skill-Set
    0.994
    Model
    93.90
    OTSR
    6.10
  • G-G
    Skill-Set
    0.970
    Model
    86.67
    OTSR
    13.33
  • Q-G
    Skill-Set
    0.943
    Model
    88.65
    OTSR
    11.35
  • Codex
    Skill-Set
    Q-Q
    Model
    0.863
    OTSR
    89.23
    SRSR (%)
    10.77
  • G-Q
    Skill-Set
    0.992
    Model
    94.50
    OTSR
    5.50
  • G-G
    Skill-Set
    0.992
    Model
    97.35
    OTSR
    2.65
  • No data
    Skill-Set
    Q-G
    Model
    0.980
    OTSR
    96.70
    SRSR (%)
    3.30
  • Repeat
    Skill-Set
    Qwen
    Model
    Q-Q
    OTSR
    0.731
    SRSR (%)
    96.13
    FRSR (%)
    3.87
  • G-Q
    Skill-Set
    0.927
    Model
    93.25
    OTSR
    6.75
  • G-G
    Skill-Set
    0.996
    Model
    81.95
    OTSR
    18.05
  • Q-G
    Skill-Set
    0.840
    Model
    88.22
    OTSR
    11.78
  • Codex
    Skill-Set
    Q-Q
    Model
    0.693
    OTSR
    98.25
    SRSR (%)
    1.75
  • G-Q
    Skill-Set
    0.929
    Model
    96.30
    OTSR
    3.70
  • G-G
    Skill-Set
    1.000
    Model
    96.97
    OTSR
    3.03
  • No data
    Skill-Set
    Q-G
    Model
    0.871
    OTSR
    96.52
    SRSR (%)
    3.48
6.4.1 Skill Retrieval Rate

Reuse Task: Table 2 show the results. These results indicate that models retrieve the correct skill from context in most cases, and that the Qwen3-Coder Cobot is more sensitive to the choice of Programmer and has more impact on the retrieval rate than on GPT5.2-Codex, although a slight decrease is also observed for GPT5.2-Codex in cross-pairing settings. Moreover, irrespective of the number of available skills (Qwen skill set: 315; Codex skill set: 415), the task success rate and skill retrieval rate are similar across skill sets for the Qwen3-Coder Cobot: 0.865, 83.64% for the Qwen skill set, and 0.863, 89.23% for the Codex skill set. The drop in success rates are likely due to difficulty in extracting the correct skill name from instructions and matching it with the available skill set.

Repeat Task: Similar to the reuse task, we further analyse how skill usage affects the repeat success rate. Table 2 shows these statistics across model configurations using the Qwen skill set and the Codex skill set. Unlike Reuse task, the skill retrieval rate is similar for the Qwen3-Coder Cobot, irrespective of the Programmer and the skill-set. However, its overall task success rate improves to 0.927, 0.929 for Qwen and Codex skill set respectively, when paired with the GPT5.2-Codex Programmer. In contrast, the overall task performance of the GPT5.2-Codex Cobot drops from 0.996 to 0.840 for the Qwen skill set and from 1.000 to 0.871 for the Codex skill set in cross-pairing. This once again highlights the sensitivity of the Cobot to the Programmer used and its impact on overall task performance.

Overall, these results suggest that the models retrieve the correct skill from context in most cases and the skill retrieval rates drive the overall task success rates across model configurations.

Table 3: Skill hallucination percentages across model configurations for Reuse and Repeat tasks computed as the ratio of hallucinated skills to the total retrieved skills. Labels denote Programmer–Cobot pairs; G-Q: GPT as Programmer and Qwen as Cobot; Q-G: Qwen as Programmer and GPT as Cobot;
  • Reuse
    Skill-Set
    Qwen
    Model
    Q-Q
    Hallucinated (%)
    29.61
  • G-Q
    Skill-Set
    34.41
  • G-G
    Skill-Set
    24.76
  • Q-G
    Skill-Set
    26.09
  • Codex
    Skill-Set
    Q-Q
    Model
    7.87
  • G-Q
    Skill-Set
    6.47
  • G-G
    Skill-Set
    4.18
  • No data
    Skill-Set
    Q-G
    Model
    3.62
  • Repeat
    Skill-Set
    Qwen
    Model
    Q-Q
    Hallucinated (%)
    31.89
  • G-Q
    Skill-Set
    33.18
  • G-G
    Skill-Set
    22.28
  • Q-G
    Skill-Set
    25.34
  • Codex
    Skill-Set
    Q-Q
    Model
    7.12
  • G-Q
    Skill-Set
    5.87
  • G-G
    Skill-Set
    3.75
  • No data
    Skill-Set
    Q-G
    Model
    3.85
6.4.2 Skill Hallucination:

Skill retrieval analysis in Section 6.4.1 shows that the models are able to retrieve most of the skills across different configurations. However, during a random manual analysis of skill usage, we observed scenarios, where the model generates a skill that is not available (the skill was not learned during reconstruction) in the model context. We refer to these scenarios as skill hallucinations and analyse their impact on the task success. However, these are not random hallucinations as the generated function call follows the correct function signature, with the correct skill name and relevant arguments. As a design choice, we execute these generated skills in the virtual simulator using the ground truth function definition. This choice allows us to isolate and evaluate the Cobot’s ability to correctly predict skill usage, specifically the correct object name, colors, locations, regardless of whether the skill exists in the library.

Table 3 shows the percentage of hallucinated skills across skill sets and model configurations. The hallucination percentages are higher when the Qwen skill set is used, as only 315 skills are available for the 495 test instances, compared to the Codex skill set, for which 415 skills are available. We also compute the success rate for these hallucinated instances and the success rate is 1.0 regardless of the model configuration, further confirming that the models generally predict task-relevant skills.

Overall, these results demonstrate that skills generated during the reconstruction task are model-agnostic and consistently improve task performance when successfully retrieved. The impact of skill reuse varies by model: for Qwen3-Coder, skill reuse primarily improves success rates, while for GPT5.2-Codex, the benefit is more in terms of cost reduction. Skill retrieval rates are high across all configurations. In cases where skills are unavailable, models tend to hallucinate skills that align with the context. Regardless of hallucination, the predicted skills align with the input context, confirming that the models generally predict task-relevant skills. When retrieval doesn’t succeed, the interaction falls back to reconstruction, where success rates vary considerably across model configurations. We also observe that both Cobots are sensitive to the choice of Programmer and this has an impact on retrieval rates. Together, these findings highlight that reliable skill retrieval and context-aware skill prediction become increasingly important as task complexity grows.

6.5 Qualitative Analysis

Figure 9: Qualitative examples (Q-Q setup) showing clarification and correction during reconstruction, misinterpretation during skill reuse, fallback from reuse to reconstruction, and hallucinated skill use. These showcase how Programmer and Cobot interact across task settings, how errors arise from ambiguous or incorrect skill selection, and how the system either continues through correction, falls back to primitive reconstruction; Q-Q: Qwen3-Coder is used as both Programmer and Cobot.

The qualitative examples in Figure 9 highlight different behaviors across the reconstruction and reuse settings. In reconstruction, the interaction supports clarification and correction. When Cobot cannot infer the instruction, it asks Programmer for additional information. Programmer then elaborates the instruction, and later corrects an error in the generated code by specifying that the washer should be red. This example shows how the multi-turn setup allows the task to continue even when the initial instruction is incomplete or when the generated code contains a mismatch.

The reuse examples show that skill availability alone does not guarantee correct skill use. In one case, Cobot misinterprets the object description by treating the two halves of a bridge as separate components, which leads to an incorrect function call. This suggests that reuse errors can also arise from Cobot interpretations. In another case, although the relevant skill is available in the context, Cobot fails to call it and instead generates primitive code. The interaction then falls back to the reconstruction loop, where Programmer continues with step-by-step instructions and corrections.

The reuse scenario also showcases a different failure mode, where Cobot calls a hallucinated skill that is not present in the available skill library. However, the generated call still uses the correct colors and location arguments, indicating that the model can sometimes infer the intended structure even when it is not available in the context. Together, these cases suggest that TAA’s multi-turn design helps recover from ambiguity and local execution errors, while reuse failures often arise from skill grounding issues, instruction misinterpretation, and incorrect selection or application of learned skills.

Figure 10: Reuse Task: Clarification behavior under skill reuse settings as a function of task complexity. (a) Clarification episodes remain sparse across all model configurations, with occasional increases for G–Q at higher complexity, while Q–Q and H–Q exhibit minimal clarification needs overall. (b) Median dialogue turns for successful instances are nearly constant, with H–Q consistently requiring two turns, and both Q–Q and G–Q completing interactions in approximately a single turn. Model Configuration: Q–Q (Qwen3-Coder–Qwen3-Coder), G–Q (GPT5.2-Codex–Qwen3-Coder), and H–Q (Human–Qwen3-Coder).
Figure 11: Repeat Task: Clarification behavior across model configuration as a function of task complexity. (a) Number of clarification episodes increases with the number of elements, with Q–Q and H–Q showing stronger sensitivity compared to G–Q. (b) Median dialogue turns for successful instances remain relatively stable, with H–Q requiring consistently more turns, while G–Q maintains minimal interaction length across all settings. Model Configuration: Q–Q (Qwen3-Coder–Qwen3-Coder), G–Q (GPT5.2-Codex–Qwen3-Coder), and H–Q (Human–Qwen3-Coder).
Table 4: Success rates on reuse and repeat tasks across model configurations, including a human baseline for the evaluated subset using Qwen skill set. Results highlight how configuration choices impact performance, with best results per task shown in bold.
  • Human-Q
    Reuse
    0.96
    Repeat
    0.94
  • Q-Q
    Reuse
    0.88
    Repeat
    0.78
  • G-Q
    Reuse
    1.00
    Repeat
    0.94

6.6 Evaluation with a Human Programmer

As mentioned in Section 5.3, we randomly selected 50 test instances for the reuse and repeat tasks and evaluated with one human Programmer as a pilot evaluation. This evaluation (see Table 4) measures the performance of the Apply step when natural language instructions are provided by a human Programmer and the Cobot is powered by Qwen3-Coder. Overall, the Cobot is able to interpret human instructions and achieves comparable success rates to the model-based Programmer configurations for both the reuse and repeat tasks. The human Programmer achieves higher success rates than the Qwen3-Coder Programmer in the same Cobot configuration, suggesting that the Cobot is able to interpret human instructions effectively.

We analyse the episodes where clarification questions are present and whether the interaction behavior differs between human and model-based Programmers. Figure 10 plot (a) shows how many episodes contain clarification questions for each model configuration in the reuse task. Q-Q has only one instance with a clarification question for a 5-element object, while G-Q has four instances for 5-element objects. H-Q has one episode each for three and four element objects. For the repeat task, the number of clarification episodes is slightly higher, with Q-Q peaking at 10 episodes for 4-element objects. We also analyse the median number of turns for all successful instances for each configuration. For the reuse task, the human Programmer consistently takes two turns while model-based Programmers take one turn. For the repeat task, the human Programmer takes three turns compared to one turn for model-based Programmers, suggesting that human instructions require more interaction to complete successfully.

Although this is a pilot study and the number of test instances are limited, this evaluation suggests that the pipeline can be extended to human Programmers, and that the Cobot can retrieve and apply skills even when instructions are human-written rather than generated by another model.

7 Conclusion

In this work, we propose the Teach-Abstract-Apply (TAA) framework, which enables users to teach collaborative robots new spatial manipulation routines through multi-turn natural language dialogue. The framework defines a three-stage pipeline: Teach, where a user interacts with the robot and iteratively refines the workflows; Abstract, where the resulting interaction trace is abstracted into a generalised behavior (skill); and Apply, where the abstracted skills are applied in different settings. We then test the TAA framework through a collaborative structure-building task, in which a Programmer instructs the Cobot to reconstruct a goal board through dialogue, the resulting interaction is abstracted into a reusable Python skill function and these abstracted skills are applied to new scenarios through reuse and repeat tasks. Our evaluation using both open-weight (Qwen3-Coder) and closed (GPT5.2-Codex) models in self-play and cross-model configurations on the SARTCo dataset demonstrates that:

  • Abstracted skills are model-agnostic and consistently improve task success rates while reducing interaction cost compared to the no-skill baseline.
  • Skill retrieval rates are high across all configurations, with models demonstrating strong context-awareness in identifying and applying relevant skills.
  • Models tend to hallucinate skills that align with the task context, and these hallucinated skills achieve a 1.0 success rate, confirming that models correctly predict skill usage even when the exact skill is absent from the library.
  • The benefit of skill reuse varies by model capability, with smaller models benefiting more in terms of success rate improvement and larger models benefiting more in terms of cost reduction.
  • A preliminary human evaluation suggests that the pipeline also works with human instructions without requiring changes to the system.

These findings demonstrate the potential of combining dialogue-based teaching with program synthesis for scalable, reusable robot skill learning. Future work will focus on expanding the human evaluation to a more diverse participant pool, and evaluating the framework on diverse tasks and modalities. Additionally, incorporating safety mechanisms for real-world deployment and exploring the integration of TAA with a physical robot arm remain important directions for future work.

8 Limitations

Our proposed TAA framework demonstrates promising results for dialogue-based robot skill acquisition, but several limitations remain.

Physical Robot: Our proposed setup uses a virtual simulator in a controlled setting. As a design choice, we did not include the physical robot in the current setup, as perception, motion planning and low-level control may introduce additional failures (Kim et al., 2026) beyond these associated with TAA components. We view this as a realistic starting point for evaluating the feasibility of TAA independently, with the potential to extend it to real-world settings involving a physical robot.

Evaluation of Skill Quality: The optimizer’s correctness is currently judged by board state reproduction and structural metrics. While execution success confirms robustness and structural metrics assess minimality, the current evaluation does not assess higher-order properties such as skill composability beyond the reuse and repeat tasks.

Baselines: The primary comparison is against a no-skill baseline within the TAA framework. To our knowledge, no existing baseline combines dialogue-based teaching with persistent skill reuse, making direct comparison with prior work challenging.

Safety: The current framework operates in a controlled simulation environment. Scaling to real-world deployment would require additional safety mechanisms, such as ambiguity detection, formal verification of generated code, or constrained APIs with whitelisted operations, to mitigate risks associated with hallucinated skills or ambiguous instructions.

Dataset Scale: The experiments are conducted on the SARTCo dataset, which covers a specific grid-world environment. Evaluating TAA on larger and more diverse datasets with varied object types, spatial configurations, and task complexities would strengthen the generalizability of the findings.

Model Dependence: The results show that the benefit of skill reuse depends on the underlying model. Smaller open-weight models such as Qwen3-Coder benefit more in terms of success rate improvement, while larger closed models such as GPT5.2-Codex benefit more in terms of cost reduction. This suggests that the framework’s effectiveness may vary with model capability.

Human Evaluation Scale: The human-in-the-loop evaluation was conducted as a pilot study with a single participant, limiting the statistical generalizability of the findings. A broader user study with a larger and more diverse participant pool, incorporating objective measures such as turns-to-success, clarification rates, and task completion time, remains an important direction for future work.

Conflict of Interest Statement

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Author Contributions

CK: coded the framework, analysed the results and wrote the original draft.; SH: contributed to the conceptualization and reviewed and edited parts of the paper. ; DS: conceived the idea, managed the project and reviewed and edited parts of the paper.

Funding

Kranti has been funded by the Bundesministerium für Bildung und Forschung (BMBF, German Federal Ministry of Research), project ”COCOBOTS” (01IS21102A) and Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) grant 423217434 (“RECOLAGE”), Completion Scholarship from Department of Linguistics and the Gertrud-Feiertag-Stipendium from the University of Potsdam.

Acknowledgments

This is a short text to acknowledge the contributions of specific colleagues, institutions, or agencies that aided the efforts of the authors.

Supplemental Data

Supplementary Material should be uploaded separately on submission, if there are Supplementary Figures, please include the caption in the same file as the figure. LaTeX Supplementary Material templates can be found in the Frontiers LaTeX folder.

Data Availability Statement

The data, framework implementation and other resources are available at: https://github.com/clp-research/cobotprogsynthesis-coderep.

References

  1. Aaltonen and Salmi (2019) I. Aaltonen and T. Salmi Experiences and expectations of collaborative robots in industry and academia: barriers and development needs. Procedia Manufacturing 38, pp. 1151–1158. Note: 29th International Conference on Flexible Automation and Intelligent Manufacturing ( FAIM 2019), June 24-28, 2019, Limerick, Ireland, Beyond Industry 4.0: Industrial Advances, Engineering Education and Intelligent Manufacturing External Links: ISSN 2351-9789, Document, Link
  2. Ajaykumar et al. (2021a) G. Ajaykumar, M. Steele, and C. Huang A survey on end-user robot programming. ACM Comput. Surv. 54 (8). External Links: ISSN 0360-0300, Link, Document
  3. Ajaykumar et al. (2021b) G. Ajaykumar, M. Stiber, and C. Huang Designing user-centric programming aids for kinesthetic teaching of collaborative robots. Robotics and Autonomous Systems 145, pp. 103845. External Links: ISSN 0921-8890, Document, Link
  4. Akella et al. (1999) P. Akella, M. A. Peshkin, J. E. Colgate, W. Wannasuphoprasit, N. Nagesh, J. Wells, S. Holland, T. Pearson, and B. Peacock Cobots for the automobile assembly line. In 1999 IEEE International Conference on Robotics and Automation, Marriott Hotel, Renaissance Center, Detroit, Michigan, USA, May 10-15, 1999, Proceedings, pp. 728–733. External Links: Link, Document
  5. Akkaladevi et al. (2019) S. C. Akkaladevi, A. Pichler, M. Plasch, M. Ikeda, and M. Hofmann Skill-based programming of complex robotic assembly tasks for industrial application. Elektrotech. Informationstechnik 136 (7), pp. 326–333. External Links: Link, Document
  6. Andersen et al. (2016) R. S. Andersen, O. Madsen, T. B. Moeslund, and H. B. Amor Projecting robot intentions into human environments. In 2016 25th IEEE International Symposium on Robot and Human Interactive Communication (RO-MAN), Vol. , pp. 294–301. External Links: Document
  7. Austin et al. (2021) J. Austin, A. Odena, M. I. Nye, M. Bosma, H. Michalewski, D. Dohan, E. Jiang, C. J. Cai, M. Terry, Q. V. Le, and C. Sutton Program synthesis with large language models. CoRR abs/2108.07732. External Links: Link, 2108.07732
  8. Ayalew et al. (2025) T. W. Ayalew, J. Wang, M. L. Littman, B. Ur, and S. Sebo Enabling end users to program robots using reinforcement learning. In 20th ACM/IEEE International Conference on Human-Robot Interaction, HRI 2025, Melbourne, Australia, March 4-6, 2025, pp. 767–777. External Links: Link, Document
  9. Barravecchia et al. (2023) F. Barravecchia, L. Mastrogiacomo, and F. Franceschini A general cost model to assess the implementation of collaborative robots in assembly processes. The International Journal of Advanced Manufacturing Technology 125 (11), pp. 5247–5266.
  10. Bauer et al. (2016) W. Bauer, M. Bender, M. Braun, P. Rally, and O. Scholtz Lightweight robots in manual assembly–best to start simply. Fraunhofer Institute for Industrial Engineering and Organization IAO, Stuttgart 1.
  11. Beschi et al. (2019) S. Beschi, D. Fogli, and F. Tampalini CAPIRCI: a multi-modal system for collaborative robot programming. In International symposium on end user development, pp. 51–66.
  12. Biggs et al. (2003) G. Biggs B. MacDonald et al. A survey of robot programming systems. In Proceedings of the Australasian conference on robotics and automation, Vol. 1, pp. 1–3.
  13. Bonial et al. (2024) C. Bonial, S. M. Lukin, M. Abrams, A. Baker, L. Donatelli, A. Foots, C. J. Hayes, C. Henry, T. Hudson, M. Marge, K. A. Pollard, R. Artstein, D. Traum, and C. R. Voss Human–robot dialogue annotation for multi-modal common ground: human–robot dialogue annotation…. Lang. Resour. Eval. 59 (2), pp. 1525–1575. External Links: ISSN 1574-020X, Link, Document
  14. Brown et al. (2020) T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, and et al Language models are few-shot learners. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin (Eds.), External Links: Link
  15. Chai et al. (2016) J. Y. Chai, R. Fang, C. Liu, and L. She Collaborative language grounding toward situated human-robot dialogue. AI Magazine 37 (4), pp. 32–45. External Links: Document, Link, https://onlinelibrary.wiley.com/doi/pdf/10.1609/aimag.v37i4.2684
  16. Chai et al. (2018) J. Y. Chai, Q. Gao, L. She, S. Yang, S. Saba-Sadiya, and G. Xu Language to action: towards interactive task learning with physical agents. In Proceedings of the 27th International Joint Conference on Artificial Intelligence, IJCAI’18, pp. 2–9. External Links: ISBN 9780999241127
  17. Chalamalasetti et al. (2023) K. Chalamalasetti, J. Götze, S. Hakimov, B. Madureira, P. Sadler, and D. Schlangen Clembench: using game play to evaluate chat-optimized language models as conversational agents. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, H. Bouamor, J. Pino, and K. Bali (Eds.), Singapore, pp. 11174–11219. External Links: Link, Document
  18. Chen et al. (2021) M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. de Oliveira Pinto, J. Kaplan, H. Edwards, Y. Burda, N. Joseph, G. Brockman, A. Ray, R. Puri, G. Krueger, M. Petrov, H. Khlaaf, G. Sastry, P. Mishkin, B. Chan, S. Gray, N. Ryder, M. Pavlov, A. Power, L. Kaiser, M. Bavarian, C. Winter, P. Tillet, F. P. Such, D. Cummings, M. Plappert, F. Chantzis, E. Barnes, A. Herbert-Voss, W. H. Guss, A. Nichol, A. Paino, N. Tezak, J. Tang, I. Babuschkin, S. Balaji, S. Jain, W. Saunders, C. Hesse, A. N. Carr, J. Leike, J. Achiam, V. Misra, E. Morikawa, A. Radford, M. Knight, M. Brundage, M. Murati, K. Mayer, P. Welinder, B. McGrew, D. Amodei, S. McCandlish, I. Sutskever, and W. Zaremba Evaluating large language models trained on code. CoRR abs/2107.03374. External Links: Link, 2107.03374
  19. Chiyah-Garcia et al. (2024) J. Chiyah-Garcia, A. Suglia, and A. Eshghi Repairs in a block world: a new benchmark for handling user corrections with multi-modal language models. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, Y. Al-Onaizan, M. Bansal, and Y. Chen (Eds.), Miami, Florida, USA, pp. 11523–11542. External Links: Link, Document
  20. Colgate et al. (1996) J. E. Colgate, W. Wannasuphoprasit, and M. A. Peshkin Cobots: robots for collaboration with human operators. In ASME international mechanical engineering congress and exposition, Vol. 15281, pp. 433–439.
  21. Cynthia (2025) S. T. Cynthia Identification and optimization of redundant code using large language models. In 2025 IEEE/ACM 4th International Conference on AI Engineering – Software Engineering for AI (CAIN), Vol. , pp. 261–263. External Links: Document
  22. Cypher and Halbert (1993) A. Cypher and D. C. Halbert Watch what i do: programming by demonstration. MIT press.
  23. Désilets (2001) A. Désilets VoiceGrip: A tool for programming-by-voice. Int. J. Speech Technol. 4 (2), pp. 103–116. External Links: Link, Document
  24. Dmytriyev et al. (2022) Y. Dmytriyev, M. Carnevale, H. Giberti, and G. Todeschini On cobot programming in industrial tasks: a test case. In 2022 International Congress on Human-Computer Interaction, Optimization and Robotic Applications (HORA), Vol. , pp. 1–9. External Links: Document
  25. Driess et al. (2023) D. Driess, F. Xia, M. S. M. Sajjadi, C. Lynch, A. Chowdhery, B. Ichter, A. Wahid, J. Tompson, Q. Vuong, T. Yu, W. Huang, Y. Chebotar, P. Sermanet, D. Duckworth, S. Levine, V. Vanhoucke, K. Hausman, M. Toussaint, K. Greff, A. Zeng, I. Mordatch, and P. Florence PaLM-e: an embodied multimodal language model. In International Conference on Machine Learning, ICML 2023, 23-29 July 2023, Honolulu, Hawaii, USA, A. Krause, E. Brunskill, K. Cho, B. Engelhardt, S. Sabato, and J. Scarlett (Eds.), Proceedings of Machine Learning Research, Vol. 202, pp. 8469–8488. External Links: Link
  26. El Zaatari et al. (2019) S. El Zaatari, M. Marei, W. Li, and Z. Usman Cobot programming for collaborative industrial tasks: an overview. Robotics and Autonomous Systems 116, pp. 162–180. External Links: ISSN 0921-8890, Document, Link
  27. Estable et al. (2002) S. Estable, I. Ahms, H.G. Backhaus, O. El Zubi, and R. Muenstermann Intuitive teaching and surveillance for production assistants. In Proceedings. 11th IEEE International Workshop on Robot and Human Interactive Communication, Vol. , pp. 474–481. External Links: Document
  28. Fogli et al. (2022) D. Fogli, L. Gargioni, G. Guida, and F. Tampalini A hybrid approach to user-oriented programming of collaborative robots. Robotics and Computer-Integrated Manufacturing 73, pp. 102234. External Links: ISSN 0736-5845, Document, Link
  29. Foster et al. (2006) M. E. Foster, T. By, M. Rickert, and A. Knoll Human-robot dialogue for joint construction tasks. In Proceedings of the 8th International Conference on Multimodal Interfaces, ICMI ’06, New York, NY, USA, pp. 68–71. External Links: ISBN 159593541X, Link, Document
  30. Fu et al. (2026) L. Fu, J. Yu, K. El-Refai, E. Kou, H. Xue, H. Huang, W. Xiao, L. Fei-Fei, G. Shi, J. Wu, S. S. Sastry, Y. Zhu, K. Goldberg, and L. Fan CaP-x: a framework for benchmarking and improving coding agents for robot manipulation. In Proceedings of the 43rd International Conference on Machine Learning, T. Zhang, M. Dudik, M. Jaggi, A. Agarwal, S. Li, D. Schuurmans, J. Zhu, F. Berkenkamp, H. Dong, and A. Bietti (Eds.), Proceedings of Machine Learning Research, Vol. 306, pp. 32155–32212. External Links: Link
  31. Ge et al. (2024) Y. Ge, Y. Dai, R. Shan, K. Li, Y. Hu, and X. Sun Cocobo: exploring large language models as the engine for end-user robot programming. In 2024 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC), Liverpool, UK, September 2-6, 2024, pp. 89–95. External Links: Link, Document
  32. George et al. (2023) P. George, C. Cheng, T. Y. Pang, and K. Neville Task complexity and the skills dilemma in the programming and control of collaborative robots for manufacturing. Applied Sciences 13 (7), pp. 4635.
  33. Giberti et al. (2022) H. Giberti, T. Abbattista, M. Carnevale, L. Giagu, and F. Cristini A methodology for flexible implementation of collaborative robots in smart manufacturing systems. Robotics 11 (1). External Links: Link, ISSN 2218-6581, Document
  34. Gorostiza and Salichs (2011) J. F. Gorostiza and M. A. Salichs End-user programming of a social robot by dialog. Robotics and Autonomous Systems 59 (12), pp. 1102–1114. External Links: ISSN 0921-8890, Document, Link
  35. Heidorn (1976) G. E. Heidorn Automatic programming through natural language dialogue: a survey. IBM Journal of Research and Development 20 (4), pp. 302–313. External Links: Document
  36. Hou et al. (2024) X. Hou, Y. Zhao, Y. Liu, Z. Yang, K. Wang, L. Li, X. Luo, D. Lo, J. Grundy, and H. Wang Large language models for software engineering: A systematic literature review. ACM Trans. Softw. Eng. Methodol. 33 (8), pp. 220:1–220:79. External Links: Link, Document
  37. Hu et al. (2026) J. Hu, R. Martin-Martin, P. Stone, R. Duan, Z. Jiang, and G. Shi SimEX: simulation-integrated robotics autoresearch. arXiv preprint arXiv:2609.38982.
  38. Hu et al. (2024) Z. Hu, J. J. Li, A. Guha, and J. Biswas Robo-instruct: simulator-augmented instruction alignment for finetuning codellms. CoRR abs/2405.20179. External Links: Link, Document, 2405.20179
  39. Huang et al. (2022) W. Huang, P. Abbeel, D. Pathak, and I. Mordatch Language models as zero-shot planners: extracting actionable knowledge for embodied agents. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, K. Chaudhuri, S. Jegelka, L. Song, C. Szepesvári, G. Niu, and S. Sabato (Eds.), Proceedings of Machine Learning Research, Vol. 162, pp. 9118–9147. External Links: Link
  40. Ichter et al. (2022) B. Ichter, A. Brohan, Y. Chebotar, C. Finn, K. Hausman, A. Herzog, D. Ho, J. Ibarz, A. Irpan, E. Jang, R. Julian, D. Kalashnikov, S. Levine, Y. Lu, C. Parada, K. Rao, P. Sermanet, A. Toshev, V. Vanhoucke, F. Xia, T. Xiao, P. Xu, M. Yan, N. Brown, M. Ahn, O. Cortes, N. Sievers, C. Tan, S. Xu, D. Reyes, J. Rettinghouse, J. Quiambao, P. Pastor, L. Luu, K. Lee, Y. Kuang, S. Jesmonth, N. J. Joshi, K. Jeffrey, R. J. Ruano, J. Hsu, K. Gopalakrishnan, B. David, A. Zeng, and C. K. Fu Do as I can, not as I say: grounding language in robotic affordances. In Conference on Robot Learning, CoRL 2022, 14-18 December 2022, Auckland, New Zealand, K. Liu, D. Kulic, and J. Ichnowski (Eds.), Proceedings of Machine Learning Research, Vol. 205, pp. 287–318. External Links: Link
  41. Ionescu and Schlund (2023) T. B. Ionescu and S. Schlund Programming cobots by voice: a pragmatic, web-based approach. International Journal of Computer Integrated Manufacturing 36 (1), pp. 86–109.
  42. Kane et al. (2022) B. Kane, F. Gervits, M. Scheutz, and M. Marge A system for robot concept learning through situated dialogue. In Proceedings of the 23rd Annual Meeting of the Special Interest Group on Discourse and Dialogue, O. Lemon, D. Hakkani-Tur, J. J. Li, A. Ashrafzadeh, D. H. Garcia, M. Alikhani, D. Vandyke, and O. Dušek (Eds.), Edinburgh, UK, pp. 659–662. External Links: Link, Document
  43. Karli et al. (2024) U. B. Karli, J. Chen, V. N. Antony, and C. Huang Alchemist: llm-aided end-user development of robot applications. In Proceedings of the 2024 ACM/IEEE International Conference on Human-Robot Interaction, HRI ’24, New York, NY, USA, pp. 361–370. External Links: ISBN 9798400703225, Link, Document
  44. Kazi et al. (2024) T. Kazi, R. Lyu, S. Zhou, D. Hakkani-Tür, and G. Tur Large language models as user-agents for evaluating task-oriented-dialogue systems. In IEEE Spoken Language Technology Workshop, SLT 2024, Macao, December 2-5, 2024, pp. 913–920. External Links: Link, Document
  45. Khattab et al. (2023) O. Khattab, A. Singhvi, P. Maheshwari, Z. Zhang, K. Santhanam, S. Vardhamanan, S. Haq, A. Sharma, T. T. Joshi, H. Moazam, H. Miller, M. Zaharia, and C. Potts DSPy: compiling declarative language model calls into self-improving pipelines. CoRR abs/2310.03714. External Links: Link, Document, 2310.03714
  46. Kim et al. (2024) C. Y. Kim, C. P. Lee, and B. Mutlu Understanding large-language model (llm)-powered human-robot interaction. In Proceedings of the 2024 ACM/IEEE International Conference on Human-Robot Interaction, HRI 2024, Boulder, CO, USA, March 11-15, 2024, D. Grollman, E. Broadbent, W. Ju, H. Soh, and T. Williams (Eds.), pp. 371–380. External Links: Link, Document
  47. Kim et al. (2026) C. Y. Kim, N. T. White, E. He, F. Sala, and B. Mutlu RoboCritics: enabling reliable end-to-end llm robot programming through expert-informed critics. HRI ’26, New York, NY, USA, pp. 914–923. External Links: ISBN 9798400721281, Link, Document
  48. Konidaris et al. (2012) G. D. Konidaris, S. Kuindersma, R. A. Grupen, and A. G. Barto Robot learning from demonstration by constructing skill trees. Int. J. Robotics Res. 31 (3), pp. 360–375. External Links: Link, Document
  49. Kranti et al. (2024) C. Kranti, S. Hakimov, and D. Schlangen Towards no-code programming of cobots: experiments with code synthesis by large code models for conversational programming. arXiv preprint arXiv:2409.11041.
  50. Kranti et al. (2025) C. Kranti, S. Hakimov, and D. Schlangen Clem:todd: a framework for the systematic benchmarking of LLM-based task-oriented dialogue system realisations. In Proceedings of the 26th Annual Meeting of the Special Interest Group on Discourse and Dialogue, F. Béchet, F. Lefèvre, N. Asher, S. Kim, and T. Merlin (Eds.), Avignon, France, pp. 62–92. External Links: Link
  51. Kuhail et al. (2021) M. A. Kuhail, S. Farooq, R. Hammad, and M. Bahja Characterizing visual programming approaches for end-user developers: a systematic review. IEEE Access 9 (), pp. 14181–14202. External Links: Document
  52. Lai et al. (2026) Y. Lai, S. Yuan, P. Li, B. Zhang, B. Kiefer, T. Deng, and A. Zell FAM-hri: foundation-model assisted multimodal human–robot interaction combining gaze and speech. IEEE Transactions on Automation Science and Engineering 23 (), pp. 10521–10534. External Links: Document
  53. Lauria et al. (2002) S. Lauria, G. Bugmann, T. Kyriacou, and E. Klein Mobile robot programming using natural language. Robotics Auton. Syst. 38 (3-4), pp. 171–181. External Links: Link, Document
  54. Leggett and Williams (1984) J. Leggett and G. Williams An empirical investigation of voice as an input modality for computer programming. International Journal of Man-Machine Studies 21 (6), pp. 493–520. External Links: ISSN 0020-7373, Document, Link
  55. Liang et al. (2023) J. Liang, W. Huang, F. Xia, P. Xu, K. Hausman, B. Ichter, P. Florence, and A. Zeng Code as policies: language model programs for embodied control. In IEEE International Conference on Robotics and Automation, ICRA 2023, London, UK, May 29 - June 2, 2023, pp. 9493–9500. External Links: Link, Document
  56. Lioutikov et al. (2017) R. Lioutikov, G. Neumann, G. Maeda, and J. Peters Learning movement primitive libraries through probabilistic segmentation. Int. J. Robotics Res. 36 (8), pp. 879–894. External Links: Link, Document
  57. Liu et al. (2023) P. Liu, W. Yuan, J. Fu, Z. Jiang, H. Hayashi, and G. Neubig Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Comput. Surv. 55 (9), pp. 195:1–195:35. External Links: Link, Document
  58. Lozano-Perez (1983) T. Lozano-Perez Robot programming. Proceedings of the IEEE 71 (7), pp. 821–841. External Links: Document
  59. Lu et al. (2026) R. Lu, Y. Wu, E. Kou, L. Fu, W. Xiao, A. Mandlekar, Y. Xu, G. Shi, K. Goldberg, A. Chen, M. Chowdhury, Y. Zhu, L. ”. Fan, and G. Wang ASPIRE: agentic /skills discovery for robotics. CoRR abs/2607.00272. External Links: Link, Document, 2607.00272
  60. Macaluso et al. (2024) A. Macaluso, N. Cote, and S. Chitta Toward automated programming for robotic assembly using chatgpt. In IEEE International Conference on Robotics and Automation, ICRA 2024, Yokohama, Japan, May 13-17, 2024, pp. 17687–17693. External Links: Link, Document
  61. Mu et al. (2024) Y. Mu, J. Chen, Q. Zhang, S. Chen, Q. Yu, C. Ge, R. Chen, Z. Liang, M. Hu, C. Tao, P. Sun, H. Yu, C. Yang, W. Shao, W. Wang, J. Dai, Y. Qiao, M. Ding, and P. Luo RoboCodeX: multimodal code generation for robotic behavior synthesis. In Proceedings of the 41st International Conference on Machine Learning, R. Salakhutdinov, Z. Kolter, K. Heller, A. Weller, N. Oliver, J. Scarlett, and F. Berkenkamp (Eds.), Proceedings of Machine Learning Research, Vol. 235, pp. 36434–36454. External Links: Link
  62. Nijkamp et al. (2023) E. Nijkamp, B. Pang, H. Hayashi, L. Tu, H. Wang, Y. Zhou, S. Savarese, and C. Xiong CodeGen: an open large language model for code with multi-turn program synthesis. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023, External Links: Link
  63. Padmakumar et al. (2022) A. Padmakumar, J. Thomason, A. Shrivastava, P. Lange, A. Narayan-Chen, S. Gella, R. Piramuthu, G. Tür, and D. Hakkani-Tür TEACh: task-driven embodied agents that chat. In Thirty-Sixth AAAI Conference on Artificial Intelligence, AAAI 2022, Thirty-Fourth Conference on Innovative Applications of Artificial Intelligence, IAAI 2022, The Twelveth Symposium on Educational Advances in Artificial Intelligence, EAAI 2022 Virtual Event, February 22 - March 1, 2022, pp. 2017–2025. External Links: Link, Document
  64. Rahit et al. (2019) K. M. T. H. Rahit, R. H. Nabil, and M. H. Huq Machine translation from natural language to code using long-short term memory. CoRR abs/1910.11471. External Links: Link, 1910.11471
  65. Robots (2024) U. Robots Why cobots? all the benefits of collaborative robots. Retrieved 8/11/2021 from https://www. universal-robots. com/products ….
  66. Rodríguez-Guerra et al. (2021) D. Rodríguez-Guerra, G. Sorrosal, I. Cabanes, and C. Calleja Human-robot interaction review: challenges and solutions for modern industrial environments. IEEE Access 9 (), pp. 108557–108578. External Links: Document
  67. Rosen et al. (2020) E. Rosen, D. Whitney, E. Phillips, G. Chien, J. Tompkin, G. Konidaris, and S. Tellex Communicating robot arm motion intent through mixed reality head-mounted displays. In Robotics Research, N. M. Amato, G. Hager, S. Thomas, and M. Torres-Torriti (Eds.), Cham, pp. 301–316. External Links: ISBN 978-3-030-28619-4
  68. Rüßmann et al. (2015) M. Rüßmann, M. Lorenz, P. Gerbert, M. Waldner, J. Justus, P. Engel, and M. Harnisch Industry 4.0: the future of productivity and growth in manufacturing industries. Boston consulting group 9 (1), pp. 54–89.
  69. Schoen et al. (2022) A. Schoen, N. White, C. Henrichs, A. Siebert-Evenstone, D. Shaffer, and B. Mutlu CoFrame: a system for training novice cobot programmers. In 2022 17th ACM/IEEE International Conference on Human-Robot Interaction (HRI), Vol. , pp. 185–194. External Links: Document
  70. Segura et al. (2025) P. Segura, O. Lobato-Calleros, I. Soria-Arguello, and E. G. Hernández-Martínez Work roles in human–robot collaborative systems: effects on cognitive ergonomics for the manufacturing industry. Applied Sciences 15 (2), pp. 744.
  71. Singh et al. (2023) I. Singh, V. Blukis, A. Mousavian, A. Goyal, D. Xu, J. Tremblay, D. Fox, J. Thomason, and A. Garg ProgPrompt: generating situated robot task plans using large language models. In IEEE International Conference on Robotics and Automation, ICRA 2023, London, UK, May 29 - June 2, 2023, pp. 11523–11530. External Links: Link, Document
  72. Stopp et al. (2001) A. Stopp, S. Horstmann, S. Kristensen, and F. Lohnert Towards interactive learning for manufacturing assistants. In Proceedings 10th IEEE International Workshop on Robot and Human Interactive Communication. ROMAN 2001 (Cat. No.01TH8591), Vol. , pp. 338–342. External Links: Document
  73. Sullivan et al. (2024) D. Sullivan, N. T. White, A. Schoen, and B. Mutlu Making informed decisions: supporting cobot integration considering business and worker preferences. In Proceedings of the 2024 ACM/IEEE International Conference on Human-Robot Interaction, HRI ’24, New York, NY, USA, pp. 706–714. External Links: ISBN 9798400703225, Link, Document
  74. Tapia et al. (2025) E. Tapia, U. Lopez-Novoa, L. Sastoque-Pinilla, and L. N. López-de-Lacalle An evaluation of large language models for code optimization. In 2025 10th International Conference on Smart and Sustainable Technologies (SpliTech), Vol. , pp. 1–5. External Links: Document
  75. Thomason et al. (2019) J. Thomason, A. Padmakumar, J. Sinapov, N. Walker, Y. Jiang, H. Yedidsion, J. Hart, P. Stone, and R. J. Mooney Improving grounded natural language understanding through human-robot dialog. In 2019 International Conference on Robotics and Automation (ICRA), pp. 6934–6941. External Links: Link, Document
  76. Töberg and Cimiano (2023) J. Töberg and P. Cimiano Generation of robot manipulation plans using generative large language models. In Seventh IEEE International Conference on Robotic Computing, IRC 2023, Laguna Hills, CA, USA, December 11-13, 2023, pp. 190–197. External Links: Link, Document
  77. Tsarouchi et al. (2016) P. Tsarouchi, S. Makris, and G. Chryssolouris Human–robot interaction review and challenges on task planning and programming. International Journal of Computer Integrated Manufacturing 29 (8), pp. 916–931.
  78. Tziafas and Kasaei (2024) G. Tziafas and H. Kasaei Lifelong robot library learning: bootstrapping composable and generalizable skills for embodied control with language models. In IEEE International Conference on Robotics and Automation, ICRA 2024, Yokohama, Japan, May 13-17, 2024, pp. 515–522. External Links: Link, Document
  79. Villani et al. (2018) V. Villani, F. Pini, F. Leali, and C. Secchi Survey on human–robot collaboration in industrial settings: safety, intuitive interfaces and applications. Mechatronics 55, pp. 248–266. External Links: ISSN 0957-4158, Document, Link
  80. Wang et al. (2024) G. Wang, Y. Xie, Y. Jiang, A. Mandlekar, C. Xiao, Y. Zhu, L. Fan, and A. Anandkumar Voyager: an open-ended embodied agent with large language models. Trans. Mach. Learn. Res. 2024. External Links: Link
  81. Wannasuphoprasit et al. (1997) W. Wannasuphoprasit, R.B. Gillespie, J.E. Colgate, and M.A. Peshkin Cobot control. In Proceedings of International Conference on Robotics and Automation, Vol. 4, pp. 3571–3576 vol.4. External Links: Document
  82. Wei et al. (2022) J. Wei, X. Wang, D. Schuurmans, M. Bosma, B. Ichter, F. Xia, E. H. Chi, Q. V. Le, and D. Zhou Chain-of-thought prompting elicits reasoning in large language models. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022, S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh (Eds.), External Links: Link
  83. White and Mutlu (2024) N. T. White and B. Mutlu End user interfaces for human-robot collaboration. In Companion of the 2024 ACM/IEEE International Conference on Human-Robot Interaction, HRI 2024, Boulder, CO, USA, March 11-15, 2024, D. Grollman, E. Broadbent, W. Ju, H. Soh, and T. Williams (Eds.), pp. 157–159. External Links: Link, Document
  84. Xu et al. (2018) L. D. Xu, E. L. Xu, and L. Li Industry 4.0: state of the art and future trends. International journal of production research 56 (8), pp. 2941–2962.
  85. Yang et al. (2023) C. Yang, X. Wang, Y. Lu, H. Liu, Q. V. Le, D. Zhou, and X. Chen Large language models as optimizers. CoRR abs/2309.03409. External Links: Link, Document, 2309.03409
  86. Zhang et al. (2023) C. Zhang, J. Chen, J. Li, Y. Peng, and Z. Mao Large language models for human–robot interaction: a review. Biomimetic Intelligence and Robotics 3 (4), pp. 100131. External Links: ISSN 2667-3797, Document, Link

9 Appendix

9.1 Interaction Framework

As mentioned in Section 4.3 of the main content, the TAA interaction framework follows the clem:todd (Kranti et al., 2025) player interaction. The Game Master orchestrates the interaction between both players: the Programmer and the Cobot. Both players are text-based LLMs. In self-play, the same LLM plays the roles of both the Programmer and the Robot, while in cross-play, different models are used as the Programmer and the Robot. While the Programmer is instructed to respond with the follow-up instruction in string format, the Robot is instructed to respond with a JSON object containing the keys status and details. The status can have the values code, clarification, or acknowledgement. The details will vary depending on the status. If the status is code, the details will contain executable code, or a string if it is clarification or acknowledgement. The Game Master receives the information from each player, strips off the anchors, and routes the response to the next step. In the case of a Robot response, it also validates whether the expected structure is followed, i.e., whether the status and details keys exist and hold only the expected values. If the status is code, the Game Master passes the player-generated code to the virtual simulator for execution, and if it is clarification or acknowledgement, it passes the response to the Programmer. If there are any errors in the code execution, the error feedback is passed to the Robot. The Robot may either correct the code or chose to ask for clarification from the Programmer if there are any ambiguities.

9.1.1 Virtual Simulator

The virtual simulator is used to execute the Robot-generated code to update the placement of components in the grid-based environment. As mentioned in Section 4 of the main content, the grid-based environment uses a 2.5D grid of size 8x8, where each grid cell allows component placement and stacking. If the code execution is successful, the resultant world is returned with cell-by-cell stacking details to the Game Master, which are then added to the Programmer’s prompt in the next turn. If there are failures during execution, the error information is passed to the Robot for further processing.

9.2 Prompt Structure

We follow the standard (Brown et al., 2020; Wei et al., 2022; Liu et al., 2023) prompting approaches to structure our Programmer and Cobot prompts. Both players are prompted in zero-shot settings. Each prompt consists of a system message, task description, environment information along with the constraints, followed by the expected response structure and the dialogue history up to that turn. Additionally, Programmer’s prompt consists the difference board (i.e., the cell-level differences between the goal board and the Robot’s reconstructed board) which can guide the Programmer in generating the follow-up instruction. In order to ensure consistent boundaries for the model inputs and outputs, we added response anchors (inspired by DSPy (Khattab et al., 2023)) [[ ## prompt ## ]] and [[ ## completed ## ]] at the beginning and end of each prompt. The interaction will be aborted if any of the players’ responses do not follow the response constraints and will continue until the Programmer responds with DONE or the maximum number of turns (15) is reached. More details about the prompt ablation studies are available in the supplementary material.

9.3 Prompt Ablation Studies

We conducted multiple experiments to refine the prompt templates and response constraints. We began by varying the number of turns required for the interaction from 1 to 20 and, based on the results (see Table 5), fixed it at 15 turns. We then continued the ablations for the number of optimization turns and retry turns and chose 10 and 3, respectively, based on the results (see Tables 6 and 7). The next set of ablations focused on the necessity of including the difference grid, error feedback, and clarification questions. Table 8 shows that the success rate decreased when these were not included in the prompt, and hence we retained them in the final prompt structure. Figures 12-to-30 shows the prompt structure used across the experiments for both the players.

Table 5: Overview of ablation results for the optimal number of turns required for the player interaction; A higher success rate indicates better performance.
  • n=1
    Abort Rate
    0.013
    Failure Rate
    0.642
    Success Rate
    0.345
  • n=3
    Abort Rate
    0.006
    Failure Rate
    0.558
    Success Rate
    0.436
  • n=5
    Abort Rate
    0.006
    Failure Rate
    0.448
    Success Rate
    0.545
  • n=10
    Abort Rate
    0.012
    Failure Rate
    0.424
    Success Rate
    0.564
  • n=15
    Abort Rate
    0.0
    Failure Rate
    0.382
    Success Rate
    0.618
  • n=20
    Abort Rate
    0.0
    Failure Rate
    0.380
    Success Rate
    0.620
Table 6: Overview of ablation results for the optimal number of turns required for the abstraction; A higher success rate indicates better performance.
  • n=1
    Abort Rate
    0.006
    Failure Rate
    0.552
    Success Rate
    0.442
  • n=3
    Abort Rate
    0.018
    Failure Rate
    0.352
    Success Rate
    0.630
  • n=5
    Abort Rate
    0.000
    Failure Rate
    0.376
    Success Rate
    0.624
Table 7: Overview of ablation results for the optimal number of turns required for the Robot to retry in case of execution errors; A higher success rate indicates better performance.
  • n=1
    Abort Rate
    0.182
    Failure Rate
    0.224
    Success Rate
    0.594
  • n=3
    Abort Rate
    0.039
    Failure Rate
    0.276
    Success Rate
    0.685
  • n=5
    Abort Rate
    0.000
    Failure Rate
    0.309
    Success Rate
    0.691
Table 8: Overview of ablation results for including various types of feedback in the interaction; A higher success rate indicates better performance.
  • No difference grid
    Abort Rate
    0.182
    Failure Rate
    0.224
    Success Rate
    0.594
  • No error feedback
    Abort Rate
    0.594
    Failure Rate
    0.055
    Success Rate
    0.352
  • No clarification questions
    Abort Rate
    0.455
    Failure Rate
    0.097
    Success Rate
    0.448
Figure 12: Part-1 of prompt template used for the Programmer in the Teach step.
Figure 13: Part-2 of prompt template used for the Programmer in the Teach step.
Figure 14: An example goal board representation.
Figure 15: An example difference board representation.
Figure 16: Part-1 of prompt template used for the Robot in the Teach step.
Figure 17: Part-2 of prompt template used for the Robot in the Teach step.
Figure 18: Part-3 of prompt template used for the Robot in the Teach step.
Figure 19: Part-4 of prompt template used for the Robot in the Teach step.
Figure 20: Part-5 of prompt template used for the Robot in the Teach step.
Figure 21: Part-6 of prompt template used for the Robot in the Teach step.
Figure 22: Part-7 of prompt template used for the Robot in the Teach step.
Figure 23: Part-8 of prompt template used for the Robot in the Teach step.
Figure 24: Part-1 of prompt template used in the Abstract step.
Figure 25: Part-2 of prompt template used in the Abstract step.
Figure 26: Part-3 of prompt template used in the Abstract step.
Figure 27: Prompt template used for the Programmer in the Reuse step.
Figure 28: Prompt template used for the Robot in the Reuse step.
Figure 29: Prompt template used for the Programmer in the Repeat step.
Figure 30: Prompt template used for the Robot in the Repeat step.