Spaces:
Sleeping
Download docs/ARCHITECTURE.md from adelevett/ELBench-live: direct link, hf CLI and curl.
- Browser
- Download file 8.01 kB
-
https://huggingface.co/spaces/adelevett/ELBench-live/resolve/main/docs/ARCHITECTURE.md
- Command line
-
hf download hf://spaces/adelevett/ELBench-live/docs/ARCHITECTURE.md
-
curl -L -o ARCHITECTURE.md https://huggingface.co/spaces/adelevett/ELBench-live/resolve/main/docs/ARCHITECTURE.md
A newer version of the Gradio SDK is available: 6.32.0
ELBench Architecture
This document describes the engineering design of ELBench: the registry, the provider abstraction, the execution model, and how to extend the framework. For an overview of the benchmark and the leaderboard, see the top-level README.
ELBench is built as an engineering system, not a one-off script. Four benchmark modules are kept in one consistent framework:
ๅฎๅ จๅฏไฟก/ Safety & Trustworthiness้ซ้ถ่ฒไบบ/ High-Level Educational Cultivationๅบๆฌๆ่ฒ/ Basic Education้็จๆจกๅ/ General Capability
Principles
- Registry-driven loading instead of hardcoded file logic
- Provider adapters instead of provider-specific branches in the runner
- Rule-based judging for objective tasks
LLM-as-a-Judgefor subjective and open-ended tasks- Stable machine-readable outputs, logs, checkpoints, and summaries
- Resume support after interruption
- Configurable concurrency with a default global cap of
100
What Is Actually Wired Today
Registered benchmark files
configs/file_registry.yaml currently resolves these files:
ๅฎๅ จๆ็ญ.jsonlๅฎๅ จๅผๅฏผ.jsonlๅฎๅ จๅ็ญ.jsonlSATAs.xlsxadversarial_prompts.xlsx้ซ้ถ่ฒไบบ-edu.jsonl้ซ้ถ่ฒไบบ-omni.jsonlknowledge.yamlquestion.yamlcross.yamlconfig_guided_task.yamlmmlu_pro_sampled.jsonlceval_sampled.jsonlifeval_sampled.jsonlmath_500_sampled.jsonlaime24_sampled.jsonlaime25.jsonlaime26.jsonlgsm8k_sampled.jsonl
Files are only considered active benchmark inputs after they are registered.
Data files not present in configs/file_registry.yaml are not part of the
runnable benchmark.
Current judge strategy
Objective tasks use rule or reference matching:
SATAs.xlsx้ซ้ถ่ฒไบบ-omni.jsonlmmlu_pro_sampled.jsonlceval_sampled.jsonlifeval_sampled.jsonlmath_500_sampled.jsonlaime24_sampled.jsonlaime25.jsonlaime26.jsonlgsm8k_sampled.jsonl
Subjective or open-ended tasks use LLM-as-a-Judge:
ๅฎๅ จๆ็ญ.jsonlๅฎๅ จๅผๅฏผ.jsonlๅฎๅ จๅ็ญ.jsonladversarial_prompts.xlsx้ซ้ถ่ฒไบบ-edu.jsonl
The repository still treats external provider integration as pluggable.
mock.default and mock.judge are included so the full pipeline can be
validated locally without real API access.
Repository Layout
.
โโโ configs/
โ โโโ app.yaml
โ โโโ basic_education.yaml
โ โโโ field_mappings.yaml
โ โโโ file_registry.yaml
โ โโโ judges.yaml
โ โโโ models.yaml
โ โโโ module_registry.yaml
โ โโโ providers.yaml
โโโ data/
โ โโโ benchmark_root/
โ โโโ ๅฎๅ
จๅฏไฟก/
โ โโโ ้ซ้ถ่ฒไบบ/
โ โโโ ๅบๆฌๆ่ฒ/
โ โโโ ้็จ/
โโโ docs/
โ โโโ TEAM_MAINTENANCE_GUIDE.zh-CN.md
โโโ results/
โโโ scripts/
โ โโโ run_benchmark.py
โโโ src/
โ โโโ elbench/
โ โโโ basic_education_runtime/
โ โโโ cli.py
โ โโโ config/
โ โโโ execution/
โ โโโ judges/
โ โโโ loaders/
โ โโโ persistence/
โ โโโ providers/
โ โโโ registry/
โ โโโ schemas/
โ โโโ summary/
โ โโโ utils/
โโโ tests/
scripts/run_benchmark.py is intentionally a thin entrypoint. The actual
benchmark logic lives under src/elbench/.
Core Architecture
Registry and schema adaptation
configs/file_registry.yamlmaps files to module, subset, task, loader, and canonical name.configs/field_mappings.yamlmaps raw dataset fields into ELBench's unified internal schema.- JSONL, XLSX, and basic-education YAML inputs are normalized into the same
Samplestructure.
Unified sample/result schema
Loaded records are normalized into a stable schema with fields such as:
sample_idsource_filemodulesubsettaskdimensionpromptreferencemetadata
Execution output includes:
provider_namemodel_idmodel_namemodel_responsejudge_resultscorejudge_reasonjudge_metadatalatency_msretry_counttimestamp
Provider abstraction
ModelClientis the common interface for model execution.- Provider-specific API differences are isolated under
src/elbench/providers/. - The main runner does not care whether a model comes from OpenAI, Anthropic, Gemini, or another vendor once the adapter exists.
Execution, concurrency, and recovery
The runner supports:
- global concurrency control
- provider/model-level concurrency limits
- retry with exponential backoff
- failure logging
- checkpoint-based resume
- raw-response persistence
- judged-result persistence
- summary generation
Default global max concurrency is 100 in configs/app.yaml.
Basic Education runtime
ๅบๆฌๆ่ฒ differs from the other modules only in execution style, not in data
governance:
- benchmark data stays under
data/benchmark_root/ๅบๆฌๆ่ฒ/ - file discovery still goes through
configs/file_registry.yaml - runtime execution is handled by
src/elbench/execution/basic_education.py - the internal runtime implementation lives under
src/elbench/basic_education_runtime/
This internal runtime was adapted from the ELMES project, but it is now packaged and maintained as part of ELBench itself.
Output Layout
outputs/
โโโ raw_responses/
โโโ judged_results/
โโโ summaries/
โโโ logs/
These directories are runtime artifacts and are intentionally ignored by Git.
Curated leaderboards and audit summaries are committed under results/.
Configuration Surface
configs/models.yaml
Concrete evaluated-model and judge-model instances, including timeout, retry, rate limits, and provider kwargs.
configs/providers.yaml
Provider adapter registry plus default provider capabilities. Current built-in adapters:
mockopenai_compatible
configs/judges.yaml
Task-to-judge routing:
rulellm
configs/basic_education.yaml
Scenario-level runtime settings for the internal basic education runtime. This file does not replace the registry; it complements it.
Extending ELBench
Add a new provider
- Implement an adapter under
src/elbench/providers/. - Register it in
configs/providers.yaml. - Add concrete models in
configs/models.yaml.
Add a new benchmark file
- Put the data file under
data/benchmark_root/. - Register it in
configs/file_registry.yaml. - Add field mappings in
configs/field_mappings.yaml. - Route judging in
configs/judges.yaml. - Add or reuse tests.
Add a future module
ELBench already reserves space for further modules. The intended path remains:
- add module registration
- add file registration
- add field mappings
- add judge routing
- add task-specific logic only if configuration cannot express the behavior
No main-runner rewrite should be required.
Maintenance
The canonical team maintenance guide is
docs/TEAM_MAINTENANCE_GUIDE.zh-CN.md. That
document explains what each maintained directory is for, which paths are
runtime-only, and what should or should not be committed.
Status
Implemented:
- config system
- file registry
- JSONL/XLSX/YAML loaders
- unified sample/result schema
- provider abstraction
- concurrent runner
- retries and checkpoint resume
- raw/judged/summary/log outputs
- rule judges for objective tasks
LLM-as-a-Judgeexecution path for subjective tasks- built-in basic-education bridge on top of the internal runtime module
Still intentionally unfinished:
- production-grade adapters for every external vendor
- finalized subjective judge rubrics and prompts
- complete future-module integration beyond the current registered files