Add SayCan-style affordance grounding (embodied_ai/39)#15
Merged
Conversation
A language model is a good planner and a bad robot: asked to "wipe the table" it
proposes "pick up the sponge" without knowing whether the robot is near the
sponge. SayCan (Ahn et al., 2022, "Do As I Can, Not As I Say") grounds the model
by scoring every skill twice and multiplying:
score(skill) = p_LLM(skill furthers the instruction) * p_affordance(works now)
so the greedy argmax walks out a feasible plan with no separate planner and never
commands a skill whose preconditions are unmet. The repo had no foundation-model
loop; this adds the smallest honest one and ties it to the existing
clarifying-question / conformal-ask-for-help line.
The contrast is built into the same file via a `ground` flag (mirroring MCL's
`augment`):
grounded: go_to_sponge -> pick_sponge -> go_to_table -> wipe (goal in 4-5 steps)
ungrounded: argmax LLM = pick_sponge from the wrong place, forever -> timeout
The "LLM" is a small, transparent scorer conditioned on the running facts (the
history-conditioned query SayCan makes) but deliberately blind to physical
preconditions — which is exactly what the affordance term grounds.
- self-contained KitchenWorld (two locations, five stochastic skills with
preconditions/affordances) + a SayCanAgent and a References section
- three smoke tests: grounded walks the feasible plan with no affordance
violations; grounded retries a stochastic skill_slip and still wins; ungrounded
language-only loops on affordance_violation and times out while grounded
succeeds on the same seed
- examples index + embodied_ai README section; example 41->42, tests 115->118
Verified across seeds 0-7 (grounded cleans every seed in 4-5 steps, retrying
slips; ungrounded never cleans).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new example,
examples/embodied_ai/39_saycan_affordance_grounding.py: a tiny, faithful SayCan loop (Ahn et al., 2022, Do As I Can, Not As I Say). The repo had no foundation-model loop; this adds the smallest honest one and ties it to the existing clarifying-question / conformal-ask-for-help line.The lesson
A language model is a good planner and a bad robot. Asked to "wipe the table" it proposes pick up the sponge — the right idea — without knowing whether the robot is anywhere near the sponge. SayCan scores every skill twice and multiplies:
The product is high only for a skill that is both useful and executable, so the greedy argmax walks out a feasible plan with no separate planner and never commands a skill whose preconditions are unmet.
The contrast is built into the same file via a
groundflag (mirroring MCL'saugment):The failure log tells the story directly: ungrounded racks up
affordance_violationevery step thentimeout; grounded has none (or a retriedskill_slip).Contents
KitchenWorld(two locations, five stochastic skills with preconditions + affordances) and aSayCanAgent.skill_slipand still wins; ungrounded loops onaffordance_violationand times out while grounded succeeds on the same seed.examples/README.mdrow + a fullexamples/embodied_ai/README.mdsection; example count 41→42 and test count 115→118 inREADME.md/docs/status.md.Verification
131 passed).References
🤖 Generated with Claude Code