Skip to content
Robotics.world

Research

CSF: Contextual Safety Filtering for Motion Generators

Text-conditioned motion generators can produce smooth, physically trackable whole-body motions, but they have no notion of scene-dependent safety: "throw a forward punch" is the same body motion…

The paper’s first page · arXiv:2610.12467
arXiv
2610.12467 · Preprint · not peer-reviewed
Published
2026-10-08
Authors
Lizhi Yang, Yiling Hou, Yao Tang, Junheng Li, Daniel Weng, Blake Werner, Aaron D. Ames

In plain words

Text-conditioned motion generators can produce smooth, physically trackable whole-body motions, but they have no notion of scene-dependent safety: "throw a forward punch" is the same body motion whether the target is a punching bag or a bystander.

Key results

  • Danger reduction up to 90%. Across the four backbones, the danger-event rate falls by up to 90% relative to unfiltered generation.
  • Benign motion is largely preserved. 88–100% of benign clips either pass through unchanged or reach the selected safe counterpart.

AI summary

Overview

Research area: Robotics safety for generative models — specifically, safety filtering of text-conditioned whole-body motion generators, with deployment on humanoid hardware.

Technical level: Advanced. The paper builds on control barrier functions (CBFs), quadratic programs, and diffusion/flow/autoregressive sampling internals; the proofs and the dual formulation require comfort with convex optimization.

Scope (one sentence): CSF is a training-free filter that turns natural-language safety rules into affine constraints on a frozen motion generator's intermediate output, using the generator's own unsafe and safe reference motions, so that the same command (for example, a punch) is blocked when a person is present but allowed when only an object is present.

What This Paper Is About

Text-conditioned motion generators can produce smooth, physically trackable whole-body motions, but they have no notion of scene-dependent safety: "throw a forward punch" is the same body motion whether the target is a punching bag or a bystander. Existing safeguards do not close this gap — prompt filters cannot see the scene, separately trained motion classifiers need labeled data and retraining when the generator changes, and geometric safety filters reason about collisions and joint limits rather than about whether an action is semantically permitted. The paper's goal is a filter that leaves the generator frozen, decides from scene context whether a requested action is allowed, and corrects only the motions that violate a scene-active rule.

Key Contributions

  1. A training-free semantic safety filter. CSF combines natural-language rule specifications, reference motions produced by the frozen generator itself, and scene context to constrain generated motion, without training an auxiliary safety model or modifying the generator.

  2. A safe-reference tracking CBF-QP over an affine semantic margin. The authors define the margin as the negative projection of the current output estimate onto the direction from a safe reference to an unsafe reference, then enforce it with a CBF-QP that also pulls toward the safe reference. They prove per-step feasibility, invariance, and optimality for any tracking strength, recover minimum-intervention correction and exact pass-through of compliant motions at γ = 0, and characterize the residual introduced by the deployed ridge relaxation.

  3. Cross-architecture evaluation on four pretrained generators. The same rules, margin, gate, and QP are applied to Kimodo-G1 (DDIM diffusion), ECHO (diffusion with DPM-Solver sampling), MotionHiFlow (flow matching in a VAE latent), and ARDY (windowed autoregressive generation over hybrid tokens), with only a thin backbone adapter changing per model.

  4. A complete real-world system on a Unitree G1. The authors deploy the ARDY-based pipeline with a pretrained SONIC whole-body tracker, including a runtime shield that redirects the remaining reference when a person enters view mid-execution.

Main Findings

  • Danger reduction up to 90%. Across the four backbones, the danger-event rate falls by up to 90% relative to unfiltered generation. Residual danger falls to 0.1 of the unfiltered rate on three backbones and to 0.2 on ECHO.

  • Benign motion is largely preserved. 88–100% of benign clips either pass through unchanged or reach the selected safe counterpart. On Kimodo, the correction is smaller than the natural variation between two unfiltered samples generated from the same command.

  • The semantic gate activates correctly. The gate selects the intended rule for every explicit and scene-triggered unsafe case across all four backbones, and leaves the rule inactive in the matched allowed scene.

  • Correction cost tracks concept separation. Normalized preservation cost ranges from 0.21 on Kimodo to 0.64 on MotionHiFlow. Kimodo's distinct motion-space margin supports minimum intervention, while MotionHiFlow's nearly flat latent margin needs a stronger pull toward the safe reference; ECHO and ARDY lie between these cases.

  • Every backbone beats a standing-pose blend. In the danger-versus-preservation plot, all four backbones fall below the line joining the degenerate filters, meaning each suppresses more danger per unit of discarded benign motion than simply blending toward a standing pose.

  • Filtering is cheap; reference construction is not. On one RTX 4090 the rule-space dual takes 0.01 to 0.18 ms for one to six active rules, and a complete filter call takes 0.3 to 1.2 ms. ECHO, MotionHiFlow, and ARDY cache references after a one-time setup of 0.6 to 0.9 s, adding no measurable per-sample overhead in the fastest case and at most 19%. Kimodo builds step-matched references during sampling, raising the time for a four-second motion from 1.61 to 7.60 s, though the QP itself accounts for only 0.14 s.

  • Hardware trials behave as intended. On the physical Unitree G1, CSF blocks explicit and deceptive person-directed punches and kicks, preserves the same skill when only an object is present, and — in the runtime trial — lets the robot begin an allowed strike but prevents completion once a person enters view.

  • Benchmark scale. 28 unsafe–benign command pairs over six concepts (four for person-directed violence, one for a child, one for an animal), three random seeds each in allowed and protected scenes, with and without CSF: 672 clips per backbone, 2,688 total (1,344 filtered, 1,344 unfiltered). Residual danger is detected independently of the margin, as persistent bursts of fast, extended effector motion above a threshold set at the unfiltered-benign 95th percentile.

Methodology in Plain English

The authors exploit a property shared by essentially all samplers: at every step, the sampler holds an internal "current best guess" of the motion it will eventually return. CSF reads that guess, checks it against semantic safety rules, and if needed replaces it with a corrected guess before the sampler continues.

For each rule (a concept plus a protected entity, such as "violently striking a child"), the frozen generator is asked to produce two example motions: one from the unsafe rule description, and one from a benign version of the current command that keeps the rest of the motion intact. The straight line from the safe example to the unsafe example defines a direction in the generator's own representation. Projecting the current guess onto that direction yields a single signed number — the margin — that is positive when the guess leans safe and negative when it leans unsafe. Because everything lives in the generator's own representation, no embedding alignment or paired labeled data is needed, and changing a rule only means regenerating two references.

These margins become linear barrier constraints in a small convex quadratic program, whose objective also pulls the guess toward the safe reference by an amount controlled by a tracking weight γ. At γ = 0 the program is the smallest correction that satisfies the active constraints, so motions that already comply are left exactly untouched. Because the number of constraints equals the number of active rules while the number of variables equals the motion representation's dimension, the authors solve the dual, which stays in rule space, and add a small ridge term to stabilize it; they prove this is exactly a hinge-penalized version of the original problem and that any violated constraint is left violated by exactly ε·λ* at the optimum.

Deciding which rules to enforce is the job of the semantic context gate. Two signals are combined with a logical OR: the prompt signal fires when the command is closer to an unsafe description than to its benign contrast, and the perception signal fires when a detected entity's label is closer to the entity a rule protects. Both comparisons are made with the generator's own text encoder, so no fixed vocabulary is needed — which is why "punch the wall" can be filtered when a person is detected. If no rule is active, the filter is the identity.

The filter is adapted to each backbone only through where the current guess is read and how strongly the safe reference is tracked: 417-dimensional motion features with γ = 0 and root channels excluded for Kimodo-G1; 38-dimensional motion features with γ = 0.2 for ECHO; VAE latents with γ = 0.5 for MotionHiFlow; and hybrid tokens with γ = 0.2 and root channels excluded for ARDY. Root channels are excluded where separable so the filter must correct the pose content rather than satisfy a rule by sliding the character away from the protected entity. For compressed latents, the margin is evaluated after the pretrained decoder, with a gradient step re-decoded each iteration.

Finally, a runtime shield handles scene changes during execution. It finds the first unexecuted window whose margin falls below a calibrated threshold, preserves the already-executed portion up to a short response buffer, and blends a safe continuation into the remaining reference, aligning it in heading and position before the unchanged tracker resumes.

Why This Matters

Impact on research. The paper reframes generative safety for motion as a contextual question rather than a conceptual one: the same action can be safe or unsafe, so suppressing a concept in the weights is the wrong lever. It shows that a generator's own outputs can serve as the semantic specification for a formal safety filter, which connects CBF-based safety filtering with text-conditioned generative modeling and gives a reusable interface that survives architecture changes.

Real-world applications:

  • Humanoid robots working in homes, hospitals, or care facilities, where a high-five, a reach, or a kick means something different depending on who is standing nearby.
  • Shared factory and warehouse floors, where the same manipulation or tool-use motion must be withheld when a coworker enters the workspace.
  • Service and hospitality robots issuing gestures, handing over objects, or performing demonstrations in public spaces with bystanders and children.
  • Safety screening for motion data generated for animation, simulation, and robot learning, where undesirable behaviors should be caught after generation rather than baked out of the model.

Industry relevance. Because the generator and tracker are never modified, CSF can be layered onto an existing text-to-motion stack as a deployment-time component, and rules can be added or changed by regenerating two references rather than retraining. The reported filter cost of 0.3 to 1.2 ms per call is small relative to the sampling loop, which matters for real-time humanoid deployment; the 1.61 s to 7.60 s slowdown on Kimodo indicates where integration engineering is still needed.

Future Directions

  • Extending CSF to the root trajectory. The current filter deliberately excludes root channels where they are separable, so the robot can only be prevented from performing an unsafe pose, not from walking toward the protected entity. The authors name redirecting locomotion as future work.

  • Regenerating safe continuations from the live scene. The runtime shield currently splices in a blended continuation; regenerating from the updated scene would better cover longer, evolving interactions.

  • Reducing architecture-dependent reference construction cost. Kimodo's step-matched references dominate its overhead, so cheaper reference construction for motion-space diffusion is an open engineering question.

  • Robustness of the context gate. Rule activation depends on detected entity labels being matched by the text encoder, and the runtime shield depends on a calibrated threshold τ; how the system behaves under missed detections, mislabeled entities, or many simultaneously active rules is not characterized in the reported results.

Target Audience

Robotics researchers and engineers working on humanoid control, safety filters, and human-robot interaction; generative-model researchers interested in inference-time safety and guidance for motion; and practitioners deploying learned motion generators on physical platforms who need a safety layer that does not require retraining the underlying model. Readers without a background in control barrier functions or convex optimization will find the problem framing and hardware results accessible, but the method and proofs assume an advanced audience.

Authors’ abstract

Text-conditioned motion generators produce trackable whole-body motion, but they have no notion of scene-dependent safety: the same action may target an object or a person. Existing safeguards either inspect the prompt, require labeled motion data, or enforce geometric constraints; therefore, they do not directly account for how scene context changes a motion's meaning. We introduce contextual safety filtering (CSF), a training-free filter that grounds natural-language…

The full abstract on arXiv
Read the original paper

Related papers