Module contents
Lesson 33 of 33Research 110 min

Embodied AI: planning with foundation models and open problems

Combine language planning, executable skills, environmental feedback and hierarchical VLAs; critically examine manipulation benchmarks, robot-data scaling and runtime oversight.

After this lesson you can

  • Implement planning that combines language-model utility and skill affordances.
  • Build an agent generating programs against robot primitives and correcting them through feedback.
  • Design a hierarchical VLM–VLA architecture and reason about its interfaces.
  • Critically analyze manipulation benchmarks and robot-data scaling evidence.
  • Propose a locally feasible research project on an open embodied-AI problem.

Before you start

An instruction is not an executable plan

“Tidy the kitchen” does not say where each object is or what actions the robot can perform. A language model can suggest a coherent sequence yet ask it to pick up an out-of-reach sponge. To act, the system needs current perception, skills with preconditions, outcome detection, and a way to stop or ask for help when it cannot continue.

Useful and possible

SayCan affordance-grounded planning combines the relevance of a language-model-proposed skill with its success value in the state. In a simplified formulation, score⁡(h)=pLM(h∣instruction,history)Vh(s)\operatorname{score}(h)=p_{LM}(h\mid \text{instruction},\text{history})V_h(s). The first score expresses task usefulness; the second estimates whether the skill can be executed now. Multiplication does not automatically make scores calibrated probabilities, and an incorrect value can still select an impossible action. If all values are zero, the agent should abstain or seek help, not arbitrarily choose the first.

InteractiveUseful and possible
SkillLanguageAffordanceProduct
Pick up sponge0.600.900.54
Go to sink0.300.900.27
Pick up apple0.100.800.08
Instruction
Sponge within reach
Best stepPick up sponge
Language and affordance scores constructed for this example, not trained-model inference. Change instruction, presence and reach and observe the product.

With probabilities 0.6, 0.3 and 0.1 and affordances 0.1, 0.9 and 0.8, products are 0.06, 0.27 and 0.08: going to the sink wins. After every action the system must observe again and evaluate skills. A value function based on an old camera view or insufficient success definition does not itself correct a bad language-model proposal.

The product requires scores to refer to the same candidate set. Adding skills or changing the language template can change normalized probabilities even when the physical situation is identical. Useful evaluation includes impossible requests and cases with alternative routes. Measure incorrect execution and abstention rates, and compare language-only and affordance-only baselines. If value is trained on a previous controller’s successes, a controller update or object change can invalidate that estimate.

The choice can change even when the command stays the same. Suppose a skill was reachable during planning but an object moved during the previous action. A product computed from stale state is no longer pertinent: perceive again, recompute affordances, and check preconditions. A high language score does not make a nonexistent object reachable, and a possible but irrelevant skill need not advance the goal. This separation also reveals which component drove the choice.

A success probability of 0.9 does not mean exactly every tenth attempt fails: it is an aggregate property under a defined distribution. To evaluate calibration, group similar predictions and compare empirical frequency on held-out episodes, with intervals reflecting sample size. Also examine costly failures separately, since one mean rate does not represent collision severity. When failure cost varies, a rational decision can incorporate that cost as well as success probability.

Programs and feedback

In code as policies, a model proposes programs calling perception and control primitives. Code as Policies studies programs with logic and geometry to compose skills. A program can express, for example, repeating until no blocks remain, but can also call an unsuitable operation or produce a dangerous trajectory. The following lab interprets an explicit Python subset via AST; it does not execute arbitrary text. It rejects attributes, imports, loops, and calls outside the list. This restriction does not make physical primitives safe: their arguments, limits, and effects must be validated independently.

InteractiveExecute and correct

Instruction: Take the sponge to the sink
Result: in progress

TableSink
  1. coger("esponja")
  2. mover("fregadero")
  3. dejar("fregadero")
Program
Step0 / 3
Four hand-built templates for moving objects, counting two blocks, and expressing a spatial relation; one fails and is corrected. These are not responses from a real LLM.

Closed-loop feedback returns the scene and action outcomes to the planner. Inner Monologue studies signals such as success detection, visual description, and human interaction. “It could not pick it up” must be supported by sensors and have uncertainty: a false detector can advance the plan without grasping anything. Set a maximum number of attempts, record evidence, and distinguish detection from control failure.

A closed loop has at least four observable moments: perceive, propose, execute, and verify. Logging only the final plan hides where failure occurred. If the detector reports “object not found,” the agent can search from another view but must limit movement and verify the area is safe. If uncertainty persists after several attempts, asking for help is valid. When comparing open and closed loop, retain the same skills and initial conditions; also measure sensor and model-call cost.

In an in-house SmolVLM2 test on simulated Push-T, a reference of the goals was shown alongside current state and a threshold fixed using 24 calibration images before evaluating 24 more from different seeds. On the held-out split, relative token score detected 7 of 8 positives but incorrectly classified 14 of 16 negatives as positive. Eight negatives were initial states and the other eight had coverage between 0.9302 and 0.9340, below the physical 0.95 threshold. Balanced accuracy was 0.5. Near-threshold and positive states were constructed by placing the piece, not policy rollouts; this small sample does not measure all possible failures. The 24 held-out images come from four seeds, two goals, and three pose types per scene; they share context and should not be treated as 24 independent trials. Greedy response was “yes” on all 24 images and differs from threshold classification. Under this protocol the verifier is not reliable for deciding success.

Verification can fail in two directions. A false positive advances the plan even though the subtask is unfinished; a false negative can cause repeated attempts at an already completed task. To calibrate a visual verifier, collect positive and negative examples, separate calibration and test scenes, fix a threshold before held-out evaluation, and report sensitivity and specificity. A confidently expressed VLM answer is not itself evidence of calibration. If no sufficiently reliable detector exists, that limitation must appear in the complete agent result.

Hierarchical VLAs separate a high level proposing subtasks from a low level generating actions. Hi Robot studies this organization across platforms. The interface should specify skill name, goal, preconditions, maximum time, success criterion, and failure signal. If the high level requests an action unknown to the low level, it needs alternatives or abstention. Latency and scene changes can invalidate a subtask between proposal and execution.

In an in-house CPU pilot with Qwen2.5-0.5B-Instruct, two goal lists were requested, blue→orange and orange→blue. Both times the model returned ["azul", "naranja"] inside a JSON block: the first respected the order and the second did not. The interpreter can accept the fenced block without changing the list, but must not correct order using the expected answer. These are only two instructions and one template; the result does not estimate a general understanding rate or test the low-level controller.

An integration trial connected that planner, the visual verifier above, and a test SmolVLA with one update. In one scene per command, the plan was blue→orange in both cases and the agent executed 20 actions per scene. After ten actions per subtask, the verifier indicated success in all four queries, but geometric coverage was insufficient in all; both episodes were marked failed. With the same seed and plan, trajectories matched: these are not two independent detector trials. Coverage was used only to measure outcome, not decide when to advance. This checks connections, not a tuned-policy evaluation.

For example, the high level could request “take the sponge to the sink” and the low level receive coger(esponja) followed by dejar(fregadero). A success response should indicate which object was grasped and where it is, not merely that movement ended. If a person removes the sponge during execution, the second subtask becomes invalid. A stable object identifier and observation timestamps help avoid confusing stale detections with current ones, but do not replace a new observation.

Lab: calibrate without looking at test

The following scores are relative masses of first “yes” versus “no” tokens obtained in the visual test above. The cell reproduces threshold selection and counts; it does not run SmolVLM or generate images. Tune threshold exclusively on calibration and use held-out seeds once. Class balance gives equal weight to sensitivity and specificity, although there are twice as many negatives as positives.

[ ]Verifier threshold and errorsBrowser
calibracion = [(0.564298272, 0, 'reset'), (0.586013436, 0, 'near'), (0.584548712, 1, 'positive'), (0.582829177, 0, 'reset'), (0.59440732, 0, 'near'), (0.591090858, 1, 'positive'), (0.594394028, 0, 'reset'), (0.616018534, 0, 'near'), (0.608340085, 1, 'positive'), (0.604605496, 0, 'reset'), (0.591277599, 0, 'near'), (0.621926665, 1, 'positive'), (0.570686996, 0, 'reset'), (0.569818556, 0, 'near'), (0.571533084, 1, 'positive'), (0.587765157, 0, 'reset'), (0.566076636, 0, 'near'), (0.572845042, 1, 'positive'), (0.59992975, 0, 'reset'), (0.612211406, 0, 'near'), (0.608137369, 1, 'positive'), (0.610014319, 0, 'reset'), (0.591532469, 0, 'near'), (0.589181423, 1, 'positive')]
prueba = [(0.582071662, 0, 'reset'), (0.592567623, 0, 'near'), (0.577234685, 1, 'positive'), (0.607423484, 0, 'reset'), (0.596894026, 0, 'near'), (0.610132754, 1, 'positive'), (0.602588356, 0, 'reset'), (0.587767959, 0, 'near'), (0.581343949, 1, 'positive'), (0.579078317, 0, 'reset'), (0.565657258, 0, 'near'), (0.587557673, 1, 'positive'), (0.588719189, 0, 'reset'), (0.576431632, 0, 'near'), (0.572908521, 1, 'positive'), (0.611622155, 0, 'reset'), (0.582006216, 0, 'near'), (0.594463468, 1, 'positive'), (0.608538628, 0, 'reset'), (0.574522972, 0, 'near'), (0.553012669, 1, 'positive'), (0.586915493, 0, 'reset'), (0.55706799, 0, 'near'), (0.578000665, 1, 'positive')]

def conteos(filas,umbral):
    tp=tn=fp=fn=0
    for score,verdad,categoria in filas:
        pred=score>=umbral
        if pred and verdad:tp+=1
        elif pred:fp+=1
        elif verdad:fn+=1
        else:tn+=1
    return tp,tn,fp,fn

def exactitud_equilibrada(filas,umbral):
    tp,tn,fp,fn=conteos(filas,umbral)
    return .5*(tp/(tp+fn)+tn/(tn+fp))

valores=sorted({score for score,_,_ in calibracion})
candidatos=[0.0]+[(a+b)/2 for a,b in zip(valores,valores[1:])]+[1.000001]
# En empate se elige el umbral mayor, reduciendo declaraciones positivas.
umbral=max(candidatos,key=lambda t:(exactitud_equilibrada(calibracion,t),t))
print('umbral fijado en calibración:',round(umbral,6))
print('calibración TP, TN, FP, FN:',conteos(calibracion,umbral))
print('prueba TP, TN, FP, FN:',conteos(prueba,umbral))
print('exactitud equilibrada de prueba:',round(exactitud_equilibrada(prueba,umbral),3))
for categoria in ('reset','near'):
    filas=[x for x in prueba if x[2]==categoria]
    print('falsos positivos',categoria,sum(score>=umbral for score,_,_ in filas),'/',len(filas))

The threshold is specific to this question, processor, and scene distribution. Repeatedly selecting against the same held-out set would turn it into another tuning set; comparing a new formulation needs a new test. Scores are rounded to nine decimals for the cell and agreement with original counts was checked.

What a benchmark demonstrates

Manipulation benchmarks enable reproducible comparisons but have limited coverage. LIBERO studies transfer and continual learning with simulated manipulation tasks and demonstrations. A 95% rate is insufficient without episode count, seeds, success definition, initial conditions, task distribution, and train–evaluation separation. With 19 successes in 20 episodes the estimate is 95%, but uncertainty remains substantial; report intervals and per-task results, not just a mean.

Success definition must include horizon too. Reaching an object at the end of a short episode, leaving it stable, and then executing another subtask are different goals. A system failing its first action should not get credit for a final state coincidentally matching a goal; record the sequence and when each transition was verified. In continual learning, report task order and measure earlier tasks after learning others, because a final average can hide forgetting.

A simulated scene may omit changing friction, calibration, deformation, shadows, or delays. A model can exploit simulator regularities; correlation with physical results must be measured on real tasks and robots, not presumed. Avoid test contamination through similar scenes, instructions, or demonstrations, and publish versions and episode limits. Aggregate results can hide systematic failure on an object or position.

Compare systems on the same seeds and retain each episode’s result. Paired seeds allow counting cases where A succeeds and B fails and vice versa; a difference in aggregate rates alone does not show whether methods fail on the same cases. With multiple tasks, report per-task results first and then declared aggregation, without accidentally overweighting tasks with more episodes. Selecting hyperparameters on final test makes the estimate optimistic; reserve validation for selection and evaluate the fixed configuration once.

Robot-data scaling combines quantity and diversity of objects, cameras, tasks, and robots. More demonstrations of one scene may improve accuracy there without covering new conditions. To compare quantity and diversity, fix interaction, training, and evaluation budgets, change one dimension at a time, and hold out complete environments. Human video provides semantics and motion without action labels; transferring it to a robot requires resolving body and observation differences. The resulting curve depends on task repertoire and is not a universal scaling law.

InteractiveQuantity and diversity in a real study
  • measured and within budget
  • measured, above estimated budget
0.000.250.500.751.001240.3080.69160.77320.84

Horizontal axis: number of objects, environments or pairs. No published results exist for gaps. Estimated cost uses 120 initial demonstrations per group and the fraction; filtering and rounding affect actual cost, so budget is not guaranteed. The maximum is selected on the same tests: it is optimistic and does not determine a universal strategy.

Training variation
2000
Best across fractions0.922
Measured combination32 × 50 %
Estimated examples1920
Published Pour Water data, tables 4–6 of Lin and colleagues: normalized progress score, not success rate. Measured combinations are shown; cost is a nominal pre-filter estimate.

Lin and colleagues studied diffusion policies with demonstrations collected on real objects and environments. In the pouring task, each table point summarizes 40 trials and a human progress score normalized by dividing by nine; it is not the percentage of completely successful episodes. Object, environment, and combined cases come from separate evaluations, so they should not be compared as paired across categories. Authors note human scoring has a subjective component; selecting the largest value among many trials can also be optimistic. The nominal estimate uses 120 initial demonstrations per group and the chosen fraction; filtering and rounding affect the actual number used, so it is neither exact cost nor a certified optimum.

With a budget of one hundred demonstrations, collect ten for each of ten objects or one hundred for the same object. The first covers more variation; the second may better describe that object’s conditions. It is not known in advance which generalizes better: this depends on example cost, demonstration noise, and held-out tasks. To isolate diversity, equalize total episodes and optimizer updates; repeat with multiple object sets and seeds. If diversity also changes task count per object, explain that dependence and avoid attributing the entire difference to one cause.

Monitoring and an open problem

Runtime monitoring combines speed and force limits, forbidden zones, stopping, and failure observation. A filter can reject commands outside the allowed set, but guarantees depend on model, sensors, and reaction time. High uncertainty can trigger abstention; high confidence does not demonstrate out-of-distribution safety. Test the layer under perturbations, include communication failures, and maintain a human intervention channel.

A generated command should pass checks before reaching the actuator: primitive type, object identity, finite values, units and limits, and scene preconditions. A software speed limit does not replace an independent stop system or hardware analysis. Timing matters too: if stopping comes after collision, the logical limit was insufficient for that speed and distance. Log rejected commands and false rejections to evaluate safety and task completion.

A stop also needs a recovery policy. In a simulator, a command can be cancelled and reset; on a physical robot a gripper may hold an object or be under load. Define what state is safe, who can authorize continuation, and what information is retained after failure. This does not remove the need to design physical stopping and check response times; it makes explicit the interface connecting monitoring, diagnosis, and restart.

A feasible local question: how does chunk length affect opposing instructions and failures after a visual perturbation? Fix demonstrations, architecture, and budget; train at least three seeds per length, hold out objects and positions, and measure per-task success, action age, collisions, and actual latency with intervals and per-episode logs. First test that opposite instructions on the same scene produce different actions. Also publish failure conditions and cost; one GPU week is a budget to measure, not a training-completion guarantee.

Lab: block world and restricted programs

In this minimal world, language scores are a table and affordances are known rules. The interpreter validates the complete AST before executing statements and only permits simple assignments, arithmetic, and direct calls to allowed primitives. It does not use exec. A primitive can fail after another has already changed state: there are no transactions or physical-safety guarantees. Observe the failure and explicit correction, both hand-programmed.

[ ]Affordances and safe executionBrowser
import ast, math

class World:
    def __init__(self):
        self.objects={'esponja':.8,'manzana':.2};self.hand=None;self.at='mesa'
    def detectar(self,name): return name in self.objects
    def mover(self,destination):
        if destination not in ('mesa','fregadero'): raise ValueError('destino desconocido')
        self.at=destination;return destination
    def coger(self,name):
        if self.at!='mesa' or self.hand is not None or name not in self.objects: raise ValueError('no se puede coger')
        self.hand=name;del self.objects[name];return name
    def dejar(self,destination):
        if self.hand is None or destination!=self.at: raise ValueError('no se puede dejar')
        self.objects[self.hand]=destination;self.hand=None;return True
    def skills(self):
        return {'coger esponja':float(self.at=='mesa' and self.hand is None and 'esponja' in self.objects),
                'ir al fregadero':float(self.hand is not None and self.at!='fregadero'),
                'dejar esponja':float(self.hand=='esponja' and self.at=='fregadero')}

def safe_run(source,api):
    if len(source)>2000:raise ValueError('programa demasiado largo')
    tree=ast.parse(source,mode='exec');variables={};budget=[100]
    allowed=(ast.Module,ast.Expr,ast.Assign,ast.Name,ast.Load,ast.Store,ast.Constant,ast.BinOp,
             ast.Add,ast.Sub,ast.Mult,ast.Div,ast.UnaryOp,ast.USub,ast.Call)
    nodes=list(ast.walk(tree))
    if len(nodes)>100 or any(not isinstance(n,allowed) for n in nodes):raise ValueError('sintaxis no permitida')
    for node in nodes:
        if isinstance(node,ast.Call) and (not isinstance(node.func,ast.Name) or node.func.id not in api or node.keywords):raise ValueError('llamada no permitida')
        if isinstance(node,ast.Assign) and (len(node.targets)!=1 or not isinstance(node.targets[0],ast.Name)):raise ValueError('asignación no permitida')
    def evaluate(node):
        budget[0]-=1
        if budget[0]<0:raise ValueError('presupuesto agotado')
        if isinstance(node,ast.Constant) and type(node.value) in (str,int,float,bool):
            value=node.value
        elif isinstance(node,ast.Name) and node.id in variables:value=variables[node.id]
        elif isinstance(node,ast.BinOp) and type(node.op) in (ast.Add,ast.Sub,ast.Mult,ast.Div):
            left=evaluate(node.left);right=evaluate(node.right)
            if type(left) not in (int,float) or type(right) not in (int,float):raise ValueError('aritmética solo numérica')
            if isinstance(node.op,ast.Add):value=left+right
            elif isinstance(node.op,ast.Sub):value=left-right
            elif isinstance(node.op,ast.Mult):value=left*right
            else:value=left/right
        elif isinstance(node,ast.UnaryOp) and isinstance(node.op,ast.USub):
            value=-evaluate(node.operand)
        elif isinstance(node,ast.Call) and isinstance(node.func,ast.Name) and node.func.id in api and not node.keywords:
            value=api[node.func.id](*[evaluate(arg) for arg in node.args])
        else:raise ValueError('operación no permitida')
        if type(value) in (int,float) and (not math.isfinite(value) or abs(value)>10000):raise ValueError('número fuera de límites')
        if type(value) is str and len(value)>100:raise ValueError('cadena demasiado larga')
        return value
    # No se llama a exec: se interpreta un subconjunto de AST.
    for stmt in tree.body:
        if isinstance(stmt,ast.Expr):evaluate(stmt.value)
        elif isinstance(stmt,ast.Assign) and len(stmt.targets)==1 and isinstance(stmt.targets[0],ast.Name):
            variables[stmt.targets[0].id]=evaluate(stmt.value)
        else:raise ValueError('sentencia no permitida')
    return variables

world=World();api={k:getattr(world,k) for k in ('detectar','mover','coger','dejar')}
# Las puntuaciones simulan un modelo de lenguaje mediante una tabla, no una inferencia real.
lm={'coger esponja':.6,'ir al fregadero':.3,'dejar esponja':.1}
programs={'coger esponja':'coger("esponja")','ir al fregadero':'mover("fregadero")','dejar esponja':'dejar("fregadero")'}
for i in range(3):
    affordance=world.skills();scores={k:lm[k]*affordance[k] for k in lm}
    best=max(scores,key=scores.get)
    if scores[best]<=0:print('sin habilidad factible');break
    safe_run(programs[best],api)
    print('paso',i+1,best,'puntaje',round(scores[best],2),'mano',world.hand,'lugar',world.at)
assert world.objects['esponja']=='fregadero'
# Fallo observado y corrección explícita; no se afirma que un LLM real haya generado el código.
world2=World();api2={k:getattr(world2,k) for k in ('detectar','mover','coger','dejar')}
try:safe_run('mover("fregadero")\ncoger("esponja")',api2)
except ValueError as error:
    print('fallo observado:',error,'; corrección: volver a mesa')
    safe_run('mover("mesa")\ncoger("esponja")\nmover("fregadero")\ndejar("fregadero")',api2)
assert world2.objects['esponja']=='fregadero'

The second execution has already moved the robot when pickup fails; correction starts from that observed state. A real planner should decide whether to retry, ask for help, or abort, and not assume the error message certainly describes the physical world.

Local lab: connecting three levels

This lab connects Qwen2.5-0.5B-Instruct to decompose the command, the previous lesson’s LoRA-tuned SmolVLA to generate actions, and SmolVLM2 to verify each subtask. Download agent, questions, LoRA loader, LoRA training, LoRA layers, LoRA resumption, window reader, data resumption, reference rendering and fixed threshold, alongside previous-lesson modules and text diffusion policy, diffusion, simulator and language tasks. They may be kept together; from the repository the public/data folders are used.

First run lesson 32 fine-tuning and retain its checkpoint, SmolVLA configuration, and SmolVLM2 tokenizer. The planner receives two opposite commands; the interpreter accepts a JSON list or one fenced JSON block without repairing order. For each subtask policy actions are executed and the verifier queried every ten steps, starting after ten actions. The VLM sees reference and scene on a square canvas and uses the threshold fixed before test; simulator coverage is logged only to evaluate the decision. At most 120 actions are allowed per subtask. Position targets are clipped to 0–512 mm and each command’s displacement limited to 50 mm; this interface differs from lesson 32’s single-goal evaluation, so rates do not isolate hierarchy effect. An incorrect positive can advance an unfulfilled plan.

The block downloads one copy of each additional model at pinned revisions and checks weights. Cards and license files for Qwen2.5-0.5B and SmolVLM2 state Apache 2.0. Use ORYON_L33_CODE_DIR and ORYON_L32_CODE_DIR if files are elsewhere; weight paths and device are configurable. Each command is evaluated on 50 scenes with the same seeds 72000 through 72049; output is saved after every episode and --resume checks hashes and protocol before continuing. The provided threshold comes from a small pose sample and has shown many false positives: this experiment also measures its failures, not converts it into a reliable detector.

[ ]Evaluating the hierarchical agentLocal GPU
import hashlib, os, subprocess, sys
from pathlib import Path
from huggingface_hub import snapshot_download
code=Path(os.environ.get('ORYON_L33_CODE_DIR','public/data/m24/l33'))
if not (code/'hierarchical_agent.py').exists():code=Path('.')
base=Path(os.environ.get('ORYON_SMOLVLA_BASE','oryon-smolvla-base'))
vlm=Path(os.environ.get('ORYON_SMOLVLM_CONFIG','oryon-smolvlm-config'))
llm=Path(os.environ.get('ORYON_L33_LLM','oryon-qwen-0.5b'))
checkpoint=Path(os.environ.get('ORYON_L32_CHECKPOINT','oryon-smolvla-lora.pt'))
blue=os.environ.get('ORYON_BLUE_DATA','oryon-language-blue');orange=os.environ.get('ORYON_ORANGE_DATA','oryon-language-orange')
l32=Path(os.environ.get('ORYON_L32_CODE_DIR','public/data/m24/l32'));lora=Path(os.environ.get('ORYON_LORA_CODE_DIR','public/data/p13/l09'))
if not (l32/'load_shared_lora.py').exists():l32=Path('.')
if not (lora/'train_smolvla_lora.py').exists():lora=Path('.')
env=os.environ.copy();env['ORYON_L32_CODE_DIR']=str(l32.resolve())
extra=[str(code.resolve()),str(l32.resolve()),str(lora.resolve()),str(Path('public/data/p13/l06').resolve()),str(Path('public/data/p13/l02').resolve()),str(Path('public/data/p13/l07').resolve()),str(Path('public/data/p13/l09').resolve())]
env['PYTHONPATH']=os.pathsep.join(extra+[env.get('PYTHONPATH','')])
if not checkpoint.exists() or not (base/'config.json').exists():raise FileNotFoundError('Ejecuta primero el ajuste de m24-l32')
if any(not (llm/name).exists() for name in ('model.safetensors','config.json','tokenizer.json','tokenizer_config.json')):
    snapshot_download('Qwen/Qwen2.5-0.5B-Instruct',revision='7ae557604adf67be50417f59c2c2f167def9a775',local_dir=llm,allow_patterns=['config.json','generation_config.json','*token*','merges.txt','vocab.json','model.safetensors'])
if any(not (vlm/name).exists() for name in ('model.safetensors','config.json','tokenizer.json','tokenizer_config.json','processor_config.json','preprocessor_config.json')):
    snapshot_download('HuggingFaceTB/SmolVLM2-500M-Video-Instruct',revision='4cde9d208e19519c36917aa170fffc7e381aa0ad',local_dir=vlm,allow_patterns=['config.json','*token*','*processor*','special_tokens_map.json','added_tokens.json','chat_template.json','model.safetensors'])
for file,expected in [(llm/'model.safetensors','fdf756fa7fcbe7404d5c60e26bff1a0c8b8aa1f72ced49e7dd0210fe288fb7fe'),(vlm/'model.safetensors','b9bfd456c9472c0acd5719d6e514c4b859891af205ee1a736552fd3497b8b0c3')]:
    with file.open('rb') as f:assert hashlib.file_digest(f,'sha256').hexdigest()==expected
subprocess.run([sys.executable,str(code/'hierarchical_agent.py'),'--policy',str(checkpoint),'--policy-type','lora','--blue',blue,'--orange',orange,
 '--smolvla-base',str(base),'--smolvla-backbone',str(vlm),'--llm',str(llm),'--vlm',str(vlm),
 '--verifier-calibration',str(code/'verifier-threshold.json'),'--paired-reference',
 '--output',os.environ.get('ORYON_L33_OUTPUT','oryon-agent-results.json'),'--episodes','50',
 '--device',os.environ.get('ORYON_L33_DEVICE','cpu'),'--resume'],check=True,env=env)
This cell needs the local lab (PyTorch with your GPU). Start it with npm run lab and open the connection link.

The result summary checks that both commands have the same seeds, recounts successes, and separates verifier errors. For example, run python analyze_agent_results.py oryon-agent-results.json resumen.json --episodes 50. Visual queries within an episode share a scene and are not independent trials. The plan is also generated once per command; repeating it on 50 scenes is not 50 independent language-model queries. A per-episode interval also does not measure policy-training variation across seeds.

InteractiveThe full agent on held-out scenes
  • Advanced without sufficient coverage
  • Did not advance with insufficient coverage
050100150200200Advanced36Did not advance

The 236 queries belong to 100 episodes and share scenes: they are not independent samples. Coverage was below 0.95 for all; there were no physical positives to estimate sensitivity.

The 50 scene pairs produced identical verification traces. Wilson interval per command: 0% to 7.1%, conditioned on this policy and assuming independent scenes.

Order
Generated planblue → orange
Order respectedYes
Successes0/50
In-house Qwen, LoRA SmolVLA and SmolVLM2 run on 50 scenes per command. The prior profile is excluded; change command to inspect the generated plan.

With final 2000-update tuning, the agent achieved 0 successes in 50 for each command, with a 95% Wilson interval of approximately [0 %, 7.1 %] per command. Qwen generated the blue-then-orange plan once for each instruction: it respected the first and changed the second’s order. The 50 scene pairs shared seed and produced identical verification traces, so they are not 100 independent planner trials. Across 236 VLM queries physical coverage was below 0.95; the verifier advanced 200 times and continued trying 36. Queries are grouped within episodes and contain no physical positives, so sensitivity cannot be estimated. Mean actions were 23.6 per episode. The detector made its own decisions; coverage only evaluated correctness. One tuning seed and two commands do not support a general conclusion about other models or tasks.

Exercises

Numeric
Language probabilities are 0.6, 0.3 and 0.1 and affordances are 0.1, 0.9 and 0.8. What is the largest product?
Quiz
What should happen if the planner proposes a skill the controller does not offer?
Quiz
A paper reports 95% in simulation. What information is needed to interpret it?
Quiz
What experiment most clearly addresses chunk-size effect with one GPU week?
Code
Implement safe_run(source, api) as an AST interpreter, without exec or eval. Permit simple-name assignments, numeric or string constants, numeric +, -, *, / operations, unary minus, and direct calls to api names without keywords. Validate the entire syntax before calling a primitive; reject attributes, imports, loops and unknown calls. Return variables.
def safe_run(source,api):
  pass
Shift+Enter to run
Key idea
An embodied agent must link language to verifiable skills, observe consequences, and stop when its capabilities or measurements are insufficient.