Skip to main content

Benchmark for evaluating LLM understanding of web UI: SiFR vs HTML vs AXTree vs Screenshots

Project description

SiFR Benchmark

How well do AI agents understand web UI?

Benchmark comparing SiFR vs HTML vs AXTree vs Screenshots across complex websites.

⚠️ This is an example run, not a definitive study. The benchmark is fully reproducible — run it yourself on your sites, your models, your use cases.

Results

Tested on Amazon with 300KB token budget, compound tasks (understand → act).

Format Understand Act Combined Tokens
SiFR 100% 25% 25% 173K
HTML 100% 0% 0% 194K
AXTree 100% 25% 25% 27K
Screenshot 75% 0% 0% 51K

Key insight: HTML understands perfectly but can't act. Screenshot sees the page but has no element IDs. Only SiFR and AXTree can both understand AND act.

Budget Matters

Budget SiFR Combined HTML Combined Winner
300KB 25% 0% SiFR
100KB 0% 50% HTML
  • Large pages (300KB+): SiFR wins — structure survives truncation
  • Small pages (100KB): HTML wins — less overhead, more content

What is SiFR?

Structured Interface Format for Representation — JSON format optimized for LLM understanding of web UI.

{
  "id": "a015",
  "tag": "a",
  "text": "Add to Cart",
  "bbox": [500, 300, 120, 40],
  "children": []
}

Key advantages:

  • Actionable IDs: Every element gets a unique ID (a015, btn003)
  • Bounding boxes: Pixel-perfect positions for design tasks
  • Structured JSON: LLMs understand JSON natively
  • Hierarchical: Parent-child relationships preserved

Installation

pip install sifr-benchmark

Prerequisites

  1. Element-to-LLM Chrome Extension — captures pages in SiFR format
  2. API Keys
    export OPENAI_API_KEY=sk-...
    export ANTHROPIC_API_KEY=sk-ant-...  # optional
    
  3. Playwright
    playwright install chromium
    

Quick Start

Full Benchmark

sifr-bench full-benchmark-e2llm https://www.amazon.com \
  -e /path/to/element-to-llm-extension \
  -s 300 \
  --mode compound

Benchmark Modes

🤖 Compound Tasks (AI Agents)

Understanding → Action pairs for autonomous agents.

sifr-bench full-benchmark-e2llm https://amazon.com -e /path/to/ext --mode compound

Tasks:

  • "Which product has the highest rating?" → "Click on it"
  • "Find items under $50" → "Add to cart"
  • "What's the top news story?" → "Open comments"

👨‍💻 Dev Tasks (Frontend Developers)

Selectors, accessibility, structure analysis.

sifr-bench full-benchmark-e2llm https://stripe.com -e /path/to/ext --mode dev

Tasks:

  • "What's a stable selector for the login button?" → btn042
  • "Which images are missing alt text?" → 3 images
  • "List all form inputs on the page" → email, password, submit
  • "Find buttons without aria-labels" → btn005, btn012

Why SiFR wins for devs:

  • Stable IDs vs fragile CSS selectors
  • Element inventory built-in
  • No DOM parsing needed

🎨 Design Tasks (UI/UX Designers)

Spacing, typography, consistency checks.

sifr-bench full-benchmark-e2llm https://stripe.com -e /path/to/ext --mode design

Tasks:

  • "What's the height of the hero section?" → ~500px
  • "Are all cards the same width?" → Yes, 4 columns
  • "How many button variants exist?" → 3 styles
  • "What's the gap between nav items?" → 24px

Why SiFR wins for designers:

  • bbox provides exact pixel measurements
  • Can calculate spacing mathematically
  • No visual estimation needed

🔄 Combined Mode

Run all task types at once.

sifr-bench full-benchmark-e2llm https://stripe.com -e /path/to/ext --mode combined -v

Options

Option Description Default
-e, --extension Path to E2LLM extension required
-s, --target-size Token budget in KB 400
-m, --models Models to test gpt-4o-mini
--mode Task type: compound/dev/design/combined compound
-v, --verbose Show detailed output false

Multi-Model Comparison

sifr-bench full-benchmark-e2llm https://amazon.com \
  -e /path/to/ext \
  -s 300 \
  -m gpt-4o-mini,gpt-4o,claude-haiku

Supported Models

Model Alias Vision
GPT-4o gpt-4o
GPT-4o Mini gpt-4o-mini
GPT-4 Turbo gpt-4-turbo
Claude Sonnet 4 claude-sonnet
Claude Haiku 4.5 claude-haiku
Claude Opus 4 claude-opus

Output Examples

Compound Tasks

Understanding + Action Results: amazon.com
┏━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ Format     ┃ Understand ┃ Act ┃ Combined ┃  Tokens ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ sifr       │       100% │ 25% │      25% │ 172,794 │
│ html_raw   │       100% │  0% │       0% │ 194,367 │
│ axtree     │       100% │ 25% │      25% │  27,223 │
│ screenshot │        75% │  0% │       0% │  51,162 │
└────────────┴────────────┴─────┴──────────┴─────────┘

Dev Tasks

Developer Tasks: stripe.com
┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━┓
┃ Format     ┃ Selector ┃ A11y ┃ Structure ┃ Overall ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━┩
│ sifr       │      80% │  60% │      100% │     75% │
│ html_raw   │      40% │  80% │       60% │     55% │
│ axtree     │      20% │ 100% │       80% │     60% │
│ screenshot │       0% │  40% │       40% │     25% │
└────────────┴──────────┴──────┴───────────┴─────────┘

Design Tasks

Design Tasks: stripe.com
┏━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ Format     ┃ Spacing ┃ Typography ┃ Consistency ┃ Overall ┃
┡━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━┩
│ sifr       │     90% │        60% │         70% │     75% │
│ screenshot │     70% │        80% │         60% │     70% │
│ html_raw   │     20% │        40% │         50% │     35% │
│ axtree     │     10% │        30% │         40% │     25% │
└────────────┴─────────┴────────────┴─────────────┴─────────┘

Other Commands

# List all benchmark runs
sifr-bench list-runs

# Compare multiple runs
sifr-bench compare benchmark_runs/run_1 benchmark_runs/run_2

# Validate SiFR files
sifr-bench validate examples/

# Show help
sifr-bench info

Run Directory Structure

benchmark_runs/run_20251208_093517/
├── captures/
│   ├── sifr/*.sifr
│   ├── html/*.html
│   ├── axtree/*.json
│   └── screenshots/*.png
├── ground-truth/*.json
├── results/
│   ├── raw_results.json
│   └── summary.json
└── run_meta.json

Why Each Format Fails

Format Understand Act Why
SiFR ✅ JSON structure ✅ Has IDs Best of both worlds
HTML ✅ Full content ❌ No stable IDs Can read, can't click
AXTree ✅ Semantic ⚠️ Own IDs IDs don't match page
Screenshot ✅ Visual ❌ No IDs at all Sees but can't act

Use Cases

For AI Agent Developers

  • Test agent accuracy before deployment
  • Compare different LLM backends
  • Benchmark against baselines

For Frontend Developers

  • Generate stable test selectors
  • Audit accessibility issues
  • Analyze component structure

For UI/UX Designers

  • Verify design system consistency
  • Check spacing and typography
  • Audit visual hierarchy

Contributing

  • Add test sites: Run benchmark on more URLs
  • Improve ground truth: Manual verification
  • New models: Add support in models.py
  • Bug reports: Open an issue

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sifr_benchmark-0.1.37.tar.gz (49.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sifr_benchmark-0.1.37-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file sifr_benchmark-0.1.37.tar.gz.

File metadata

  • Download URL: sifr_benchmark-0.1.37.tar.gz
  • Upload date:
  • Size: 49.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sifr_benchmark-0.1.37.tar.gz
Algorithm Hash digest
SHA256 6eef28bac38c1978ae2b9dfa820cf8382069dd230903fc160416dc1a06d9b517
MD5 997b8097edbcb1aa9c895c09418485ac
BLAKE2b-256 b43b390c1fbc7860bdfe8c22d2528f6de8c3e84d05b1ba2b6eff599c84fdae84

See more details on using hashes here.

Provenance

The following attestation bundles were made for sifr_benchmark-0.1.37.tar.gz:

Publisher: benchmark.yml on Alechko375/sifr-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sifr_benchmark-0.1.37-py3-none-any.whl.

File metadata

File hashes

Hashes for sifr_benchmark-0.1.37-py3-none-any.whl
Algorithm Hash digest
SHA256 1df26e938fd4ad50a731219813250448d78a60b45c490bc12887d2698fcd1ca7
MD5 62cfc0610c0350993d964576e02480a0
BLAKE2b-256 3f4ff4452d87fc4424ce2888f4ce210e15f9f843840893795000ca9963483fba

See more details on using hashes here.

Provenance

The following attestation bundles were made for sifr_benchmark-0.1.37-py3-none-any.whl:

Publisher: benchmark.yml on Alechko375/sifr-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page