--- title: TalkingHeadBench emoji: ๐ŸŽญ colorFrom: indigo colorTo: purple sdk: docker app_port: 8000 pinned: false license: mit short_description: Talking-head LoRA diagnostic reasoning benchmark base_path: /web --- # TalkingHeadBench ๐ŸŽญ > **An open-source diagnostic reasoning benchmark for evaluating AI agents on talking-head video LoRA pipelines.** [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![OpenEnv](https://img.shields.io/badge/OpenEnv-v1.0-green.svg)](https://github.com/meta-pytorch/OpenEnv) [![HuggingFace](https://img.shields.io/badge/๐Ÿค—-LTX--2.3--22b--AV--LoRA-orange)](https://huggingface.co/elix3r/LTX-2.3-22b-AV-LoRA-talking-head) --- ## Overview **TalkingHeadBench** challenges AI agents to act as **senior engineers** who audit and optimize talking-head video LoRA pipelines โ€” identifying failure modes in reference images, training datasets, and final model weights *before a single frame is ever rendered*. The benchmark focuses on **diagnostic reasoning**, not generative performance. All signals are pre-extracted (face occupancy ratios, yaw/pitch degrees, landmark stability scores, canonical SVD weight components), making episodes run in **seconds** without GPU inference. --- ## ๐Ÿ—๏ธ Architecture The pipeline is divided into **3 coupled sub-environments** spanning **9 deterministic nodes**: ``` Episode โ”œโ”€โ”€ Sub-env 1 โ€” Reference Image & Prompt Audit (weight: 25%) โ”‚ โ”œโ”€โ”€ Node 1 โ€” Image Diagnostician โ”‚ โ”œโ”€โ”€ Node 2 โ€” Parameter Anomaly Detector โ”‚ โ””โ”€โ”€ Node 3 โ€” Grader โ”‚ โ”œโ”€โ”€ Sub-env 2 โ€” Dataset Clip Health Audit (weight: 35%) โ”‚ โ”œโ”€โ”€ Node 4 โ€” Clip Signal Extractor โ”‚ โ”œโ”€โ”€ Node 5 โ€” Disposition Classifier โ”‚ โ””โ”€โ”€ Node 6 โ€” Grader โ”‚ โ””โ”€โ”€ Sub-env 3 โ€” Trained LoRA Weight Behavioral Audit (weight: 40%) โ”œโ”€โ”€ Node 7 โ€” Weight Signal Extractor โ”œโ”€โ”€ Node 8 โ€” Phoneme Risk Assessor โ””โ”€โ”€ Node 9 โ€” Behavioral Audit Grader ``` ### Non-Linear Coupling Sub-environments are **hard-coupled**: a poor audit in Sub-env 1 (e.g., missing a lateral pose risk) causes Sub-env 2 to receive harder dataset clips with deeper identity drift, mirroring real-world cascading failures. ### Final Reward Formula ``` final_score = 0.25 ร— subenv1 + 0.35 ร— subenv2 + 0.40 ร— subenv3 ``` See [`REWARD_LOGIC.md`](REWARD_LOGIC.md) for per-dimension scoring breakdowns. --- ## ๐Ÿ“ Project Structure ``` TalkingHeadBench/ โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ pipeline.py # Episode orchestrator (run_episode_from_bundle) โ”‚ โ”œโ”€โ”€ evaluate.py # CLI evaluation harness (dry-run + scoring) โ”‚ โ”œโ”€โ”€ envs/ โ”‚ โ”‚ โ”œโ”€โ”€ subenv1/ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ node1_image_diagnostician.py โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ node2_param_anomaly.py โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ node3_grader.py โ”‚ โ”‚ โ”œโ”€โ”€ subenv2/ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ node4_clip_extractor.py โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ node5_disposition.py โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ node6_grader.py โ”‚ โ”‚ โ””โ”€โ”€ subenv3/ โ”‚ โ”‚ โ”œโ”€โ”€ node7_weight_extractor.py โ”‚ โ”‚ โ”œโ”€โ”€ node8_phoneme_risk.py โ”‚ โ”‚ โ””โ”€โ”€ node9_grader.py โ”‚ โ”œโ”€โ”€ schemas/ โ”‚ โ”‚ โ”œโ”€โ”€ subenv1.py # Pydantic models: ImageDiagnosticsObservation, etc. โ”‚ โ”‚ โ”œโ”€โ”€ subenv2.py # Pydantic models: ClipSignalObservation, etc. โ”‚ โ”‚ โ”œโ”€โ”€ subenv3.py # Pydantic models: WeightSignalObservation, etc. โ”‚ โ”‚ โ””โ”€โ”€ ground_truth.py # GroundTruth schema for all sub-envs โ”‚ โ””โ”€โ”€ utils/ โ”‚ โ”œโ”€โ”€ canonical.py # Canonical SVD + weight decomposition utilities โ”‚ โ””โ”€โ”€ grader_utils.py # Shared scoring helpers (F1, NDCG, recall) โ”‚ โ”œโ”€โ”€ server/ โ”‚ โ”œโ”€โ”€ app.py # FastAPI app (OpenEnv-compliant /reset, /step) โ”‚ โ”œโ”€โ”€ talking_head_environment.py # Gymnasium-style environment wrapper โ”‚ โ”œโ”€โ”€ Dockerfile # Container definition โ”‚ โ””โ”€โ”€ requirements.txt # Server-side dependencies โ”‚ โ”œโ”€โ”€ tests/ โ”‚ โ”œโ”€โ”€ unit/ # Unit tests for individual nodes and schemas โ”‚ โ”‚ โ”œโ”€โ”€ test_node4_extractor.py โ”‚ โ”‚ โ”œโ”€โ”€ test_node7_extractor.py โ”‚ โ”‚ โ”œโ”€โ”€ test_canonical.py โ”‚ โ”‚ โ”œโ”€โ”€ test_graders.py โ”‚ โ”‚ โ”œโ”€โ”€ test_schemas.py โ”‚ โ”‚ โ”œโ”€โ”€ test_subenv1.py โ”‚ โ”‚ โ”œโ”€โ”€ test_subenv2.py โ”‚ โ”‚ โ””โ”€โ”€ test_subenv3.py โ”‚ โ””โ”€โ”€ smoke/ # Integration & boundary tests โ”‚ โ”œโ”€โ”€ test_pipeline_e2e.py โ”‚ โ”œโ”€โ”€ test_pipeline_bundle.py โ”‚ โ”œโ”€โ”€ test_schema_roundtrip.py โ”‚ โ”œโ”€โ”€ test_grader_arithmetic.py โ”‚ โ”œโ”€โ”€ test_node1_boundaries.py โ”‚ โ”œโ”€โ”€ test_node2_boundaries.py โ”‚ โ”œโ”€โ”€ test_node5_boundaries.py โ”‚ โ”œโ”€โ”€ test_node7_deep.py โ”‚ โ”œโ”€โ”€ test_node8_boundaries.py โ”‚ โ”œโ”€โ”€ test_evaluate_cli.py โ”‚ โ””โ”€โ”€ test_validate_annotations_cli.py โ”‚ โ”œโ”€โ”€ scripts/ โ”‚ โ”œโ”€โ”€ extract_subenv1_signals.py # Signal extraction for Sub-env 1 โ”‚ โ”œโ”€โ”€ extract_subenv2_signals.py # Signal extraction for Sub-env 2 โ”‚ โ”œโ”€โ”€ extract_subenv3_signals.py # Signal extraction for Sub-env 3 โ”‚ โ”œโ”€โ”€ generate_annotation_worksheet.py โ”‚ โ”œโ”€โ”€ validate_annotations.py โ”‚ โ”œโ”€โ”€ convert_captions.py โ”‚ โ””โ”€โ”€ export_test_set.py โ”‚ โ”œโ”€โ”€ docs/ โ”‚ โ”œโ”€โ”€ PROJECT_OVERVIEW.md โ”‚ โ”œโ”€โ”€ OPENENV_INTEGRATION_GUIDE.md โ”‚ โ”œโ”€โ”€ CODEBASE_REVIEW.md โ”‚ โ””โ”€โ”€ annotation_worksheet_subenv{1,2,3}.md โ”‚ โ”œโ”€โ”€ client.py # OpenEnv client helper โ”œโ”€โ”€ openenv.yaml # OpenEnv manifest (runtime: fastapi, port: 8000) โ”œโ”€โ”€ pyproject.toml # Package config (openenv-talking-head-bench v1.0.0) โ”œโ”€โ”€ requirements.txt # Top-level dependencies โ”œโ”€โ”€ REWARD_LOGIC.md # Detailed scoring documentation โ””โ”€โ”€ LICENSE # MIT ``` --- ## ๐Ÿš€ Quick Start ### Prerequisites - Python 3.10+ - pip or [uv](https://github.com/astral-sh/uv) ### Installation ```bash git clone https://github.com/22elix3r/TalkingHeadBench.git cd TalkingHeadBench # Standard pip pip install -r requirements.txt # Or install as a package (recommended for OpenEnv usage) pip install -e ".[dev]" ``` ### Run an Episode (Python API) ```python from src.pipeline import run_episode_from_bundle, EpisodeResult bundle = { "reference_image_obs": { # ImageDiagnosticsObservation fields "face_occupancy_ratio": 0.42, "yaw_degrees": 28.5, "pitch_degrees": -4.1, "landmark_stability_score": 0.81, # ... }, "param_config": { "cfg": 5.5, "denoise_alt": 0.5, "eta": 0.08 }, "clip_signal_obs_list": [ # list of ClipSignalObservation dicts ], "weight_obs": { # WeightSignalObservation fields }, "ground_truths": { # ground truth annotations for all sub-envs }, } result: EpisodeResult = run_episode_from_bundle(bundle) print(f"Final score: {result.final_score:.3f}") print(f" Sub-env 1: {result.subenv1_score:.3f}") print(f" Sub-env 2: {result.subenv2_score:.3f}") print(f" Sub-env 3: {result.subenv3_score:.3f}") ``` ### CLI Evaluation Harness ```bash # Dry-run (schema validation only) python -m src.evaluate --dry-run --test-set tests/test_set/ # Full scoring run python -m src.evaluate --test-set tests/test_set/ --verbose ``` --- ## ๐ŸŒ OpenEnv Server TalkingHeadBench is packaged as an [OpenEnv](https://github.com/meta-pytorch/OpenEnv)-compliant environment with a Gymnasium-style `reset` / `step` API served over FastAPI. ### Run Locally ```bash pip install openenv-core[core]>=0.2.2 uvicorn server.app:app --host 0.0.0.0 --port 8000 ``` ### Run with Docker ```bash docker build -t talking-head-bench -f server/Dockerfile . docker run -p 8000:8000 talking-head-bench ``` ### Client Usage ```python from client import TalkingHeadBenchEnv with TalkingHeadBenchEnv(base_url="http://localhost:8000").sync() as env: obs = env.reset() # Receives ImageDiagnosticsObservation obs = env.step(action_1) # Sub-env 1 decision โ†’ receives ParamAnomalyObservation obs = env.step(action_2) # Sub-env 2 decision โ†’ receives WeightSignalObservation obs = env.step(action_3) # Sub-env 3 decision โ†’ episode done print(obs.reward) # Final weighted score ``` ### Episode Flow | Step | Transition | Agent Receives | Agent Returns | |------|-----------|----------------|---------------| | `reset` | โ€” | `ImageDiagnosticsObservation` | โ€” | | `step 1` | Node 1 โ†’ Node 2 | `ParamAnomalyObservation` | `ImageDiagnosticsAction` | | `step 2` | Node 4 โ†’ Node 6 | `ClipDispositionObservation` | `ParamAnomalyAction` | | `step 3` | Node 7 โ†’ Node 9 | done + `final_score` | `PhonemeRiskAction` | --- ## ๐Ÿงช Test Suite ```bash # Run all tests pytest # Unit tests only pytest tests/unit/ # Smoke / integration tests pytest tests/smoke/ # With coverage pytest --cov=src --cov-report=term-missing ``` | Test Module | Coverage Area | |---|---| | `test_schemas.py` | Pydantic model validation (all sub-envs) | | `test_schema_roundtrip.py` | Schema serialization / deserialization | | `test_grader_arithmetic.py` | Reward formula correctness | | `test_node1_boundaries.py` | Node 1 edge cases | | `test_node2_boundaries.py` | Node 2 edge cases | | `test_node4_extractor.py` | Clip signal extraction | | `test_node5_boundaries.py` | Disposition classifier boundaries | | `test_node7_extractor.py` | Weight signal extraction | | `test_node7_deep.py` | Deep Node 7 heuristic tests | | `test_node8_boundaries.py` | Phoneme risk assessor boundaries | | `test_pipeline_e2e.py` | Full episode end-to-end | | `test_pipeline_bundle.py` | Bundle format validation | | `test_evaluate_cli.py` | CLI harness integration | --- ## ๐Ÿ“Š Scoring Reference ### Sub-env 1 โ€” Reference Image & Prompt Audit (25%) | Dimension | Weight | Method | |-----------|--------|--------| | Regime Classification | 0.35 | Exact match (1.0), borderline (0.7), wrong (0.0) | | Risk Factor Recall | 0.35 | Set intersection recall | | Prompt Modification Validity | 0.30 | Precision against curated valid set | ### Sub-env 2 โ€” Dataset Clip Health Audit (35%) | Dimension | Weight | Method | |-----------|--------|--------| | Disposition Match | 0.40 | Exact + confidence calibration | | Fix Instruction Quality | 0.20 | Precision โ‰ฅ 0.8 โ†’ full, โ‰ฅ 0.5 โ†’ half | | Dataset Impact Reasoning | 0.20 | Keyword element matching | | Override Misuse Penalty | โˆ’0.10 | Unjustified override โ†’ penalty | ### Sub-env 3 โ€” LoRA Weight Behavioral Audit (40%) | Dimension | Weight | Method | |-----------|--------|--------| | Phoneme Risk Ranking | 0.25 | NDCG against reference ranking | | Behavior Trigger Prediction | 0.20 | Set F1 on (phoneme, behavior) pairs | | Cluster Identification | 0.20 | Overlap with reference clusters | | Safety Calibration | 0.15 | Ordinal distance | | Mitigation Quality | 0.20 | (target, action) pair matching | --- ## ๐Ÿค— Reference Model This benchmark is designed to evaluate agents working with: ๐Ÿ”— **[elix3r/LTX-2.3-22b-AV-LoRA-talking-head](https://huggingface.co/elix3r/LTX-2.3-22b-AV-LoRA-talking-head)** --- ## Design Principles | Property | Description | |----------|-------------| | **No live generation** | All signals are pre-extracted; no GPU inference required during evaluation | | **Deterministic** | All graders are rule-based โ€” no LLM judge, fully reproducible | | **Partial credit** | Borderline answers receive scaled scores, not binary pass/fail | | **Cascading difficulty** | Sub-env 1 risk profile influences Sub-env 2 context | | **Fast episodes** | Full evaluation completes in seconds | --- ## ๐Ÿ“– Documentation | Document | Description | |----------|-------------| | [`docs/PROJECT_OVERVIEW.md`](docs/PROJECT_OVERVIEW.md) | Full architecture and design reference | | [`docs/OPENENV_INTEGRATION_GUIDE.md`](docs/OPENENV_INTEGRATION_GUIDE.md) | OpenEnv compliance and deployment guide | | [`docs/CODEBASE_REVIEW.md`](docs/CODEBASE_REVIEW.md) | File-by-file codebase audit | | [`REWARD_LOGIC.md`](REWARD_LOGIC.md) | Detailed scoring and reward formula | --- ## Citation ```bibtex @software{TalkingHeadBench2026, author = {elix3r}, title = {TalkingHeadBench: A Diagnostic Reasoning Benchmark for Talking-Head LoRA Pipelines}, year = {2026}, url = {https://github.com/22elix3r/TalkingHeadBench}, version = {1.0.0} } ``` --- ## License Licensed under the **MIT License** โ€” see [`LICENSE`](LICENSE) for details.