The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: DatasetGenerationCastError
Exception: DatasetGenerationCastError
Message: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 3 new columns ({'tables_count', 'query', 'complexity'}) and 2 missing columns ({'category', 'prompt'}).
This happened while the json dataset builder was generating data using
hf://datasets/mayank-dubey-ai/enterprise-100-db-steering/eval_queries_10.json (at revision 749ed5209d72f53f678e97db9c41a3db1190a58b), ['hf://datasets/mayank-dubey-ai/enterprise-100-db-steering@749ed5209d72f53f678e97db9c41a3db1190a58b/test_prompts.json', 'hf://datasets/mayank-dubey-ai/enterprise-100-db-steering@749ed5209d72f53f678e97db9c41a3db1190a58b/eval_queries_10.json'], ['hf://datasets/mayank-dubey-ai/enterprise-100-db-steering@749ed5209d72f53f678e97db9c41a3db1190a58b/test_prompts.json', 'hf://datasets/mayank-dubey-ai/enterprise-100-db-steering@749ed5209d72f53f678e97db9c41a3db1190a58b/eval_queries_10.json']
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1848, in _prepare_split_single
writer.write_table(table)
~~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 765, in write_table
self._write_table(pa_table, writer_batch_size=writer_batch_size)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 773, in _write_table
pa_table = table_cast(pa_table, self._schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
raise CastError(
...<3 lines>...
)
datasets.table.CastError: Couldn't cast
id: string
complexity: string
tables_count: int64
tables: list<item: string>
child 0, item: string
query: string
to
{'id': Value('string'), 'prompt': Value('string'), 'tables': List(Value('string')), 'category': Value('string')}
because column names don't match
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
~~~~~~~~~~~~~~~~~~~~~~~~~^
builder, max_dataset_size_bytes=max_dataset_size_bytes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
for job_id, done, content in self._prepare_split_single(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1850, in _prepare_split_single
raise DatasetGenerationCastError.from_cast_error(
...<4 lines>...
)
datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 3 new columns ({'tables_count', 'query', 'complexity'}) and 2 missing columns ({'category', 'prompt'}).
This happened while the json dataset builder was generating data using
hf://datasets/mayank-dubey-ai/enterprise-100-db-steering/eval_queries_10.json (at revision 749ed5209d72f53f678e97db9c41a3db1190a58b), ['hf://datasets/mayank-dubey-ai/enterprise-100-db-steering@749ed5209d72f53f678e97db9c41a3db1190a58b/test_prompts.json', 'hf://datasets/mayank-dubey-ai/enterprise-100-db-steering@749ed5209d72f53f678e97db9c41a3db1190a58b/eval_queries_10.json'], ['hf://datasets/mayank-dubey-ai/enterprise-100-db-steering@749ed5209d72f53f678e97db9c41a3db1190a58b/test_prompts.json', 'hf://datasets/mayank-dubey-ai/enterprise-100-db-steering@749ed5209d72f53f678e97db9c41a3db1190a58b/eval_queries_10.json']
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
id string | prompt string | tables list | category string |
|---|---|---|---|
q1_user_address | Find all users and their registered delivery addresses with their current profile country. | [
"users",
"delivery_addresses",
"user_profiles"
] | user_profiles |
q2_orders_products_pricing | Retrieve customer orders along with product names, ordered quantities, unit prices, and user emails. | [
"orders",
"users",
"order_items",
"product_variants",
"products"
] | sales_fulfillment |
q3_org_subscription_invoices | List organizations, their subscription tiers, billing account balances, and recent invoice amounts. | [
"organizations",
"org_tiers",
"billing_accounts",
"invoices"
] | financial_billing |
q4_warehouse_inventory_locations | Show warehouse stock quantities on hand for each product variant, along with warehouse location names, cities, and product brand. | [
"warehouse_stocks",
"product_variants",
"products",
"inventory_locations"
] | supply_chain |
q5_crm_tickets_agent_activity | Extract open customer support tickets with user email, subject, priority, and ticket message history. | [
"tickets",
"users",
"ticket_messages",
"organizations"
] | crm_support |
q01_user_addresses | null | [
"users",
"delivery_addresses"
] | null |
q02_categories_subcategories | null | [
"categories",
"subcategories"
] | null |
q03_warehouse_stocks_locations | null | [
"warehouse_stocks",
"product_variants",
"inventory_locations"
] | null |
q04_orgs_tiers_billing | null | [
"organizations",
"org_tiers",
"billing_accounts"
] | null |
q05_support_tickets_messages | null | [
"tickets",
"users",
"ticket_messages",
"organizations"
] | null |
q06_products_variants_pricing | null | [
"products",
"product_variants",
"price_tiers",
"price_lists"
] | null |
q07_orders_items_products | null | [
"orders",
"users",
"order_items",
"product_variants",
"products"
] | null |
q08_supplier_purchase_orders | null | [
"suppliers",
"purchase_orders",
"po_items",
"raw_materials",
"vendor_ratings"
] | null |
q09_invoices_transactions_billing | null | [
"invoices",
"payment_transactions",
"payment_methods",
"billing_accounts",
"organizations"
] | null |
q10_marketing_conversions_orders | null | [
"campaigns",
"sent_emails",
"click_events",
"web_sessions",
"conversion_events",
"orders"
] | null |
Enterprise-100: Multi-Table Database Activation Steering & Benchmark
This repository contains a 100-table synthetic enterprise relational SQLite database, multi-table join benchmarks (2 to 6 table joins), activation steering vectors for Qwen3-8B, and automated evaluation scripts with Gemini 2.5 Flash as an LLM judge.
ποΈ 1. The 100-Table Enterprise Database Schema (enterprise_100.db)
Contains 100 interrelated tables across 10 core business domains:
- Core Users (10 tables):
users,user_profiles,user_settings,auth_tokens,roles,permissions,role_permissions,user_roles,login_history,user_devices - Organizations (10 tables):
organizations,org_members,org_invites,departments,teams,team_members,org_tiers,org_settings,api_keys,oauth_apps - Catalog & Inventory (10 tables):
categories,subcategories,products,product_variants,product_attributes,attribute_values,inventory_locations,warehouse_stocks,stock_transfers,stock_adjustments - Pricing & Promotions (10 tables):
currency_rates,price_lists,price_tiers,discount_coupons,coupon_usages,flash_sales,bundle_deals,loyalty_programs,loyalty_tiers,customer_points - Orders & Fulfillment (10 tables):
order_statuses,delivery_addresses,orders,order_items,order_notes,fulfillments,fulfillment_items,shipments,carrier_tracking,returns - Payments & Billing (10 tables):
billing_accounts,payment_methods,invoices,invoice_line_items,payment_transactions,refunds,subscription_plans,customer_subscriptions,payouts,tax_rates - CRM & Support (10 tables):
pipeline_stages,contacts,leads,sales_opportunities,crm_activities,tickets,ticket_messages,ticket_tags,customer_feedback,agent_ratings - Marketing & Engagement (10 tables):
campaigns,campaign_audiences,email_templates,sent_emails,click_events,web_sessions,session_pageviews,ad_campaigns,conversion_events,push_notifications - Procurement (10 tables):
suppliers,supplier_contacts,supplier_contracts,raw_materials,purchase_orders,po_items,po_receipts,vendor_ratings,procurement_approvals,reorder_rules - Audit & Telemetry (10 tables):
audit_logs,system_events,security_incidents,metric_snapshots,api_usage_logs,background_jobs,error_traces,feature_flags,flag_evaluations,data_retention_policies
β‘ 2. Activation Steering Dynamics (Layer 16 on Qwen3-8B)
Using representation engineering, we extract steering vectors from contrast pairs:
During autoregressive generation, a PyTorch forward hook intervenes on the residual stream at Layer 16:
- $\alpha < 0$ (Negative Steering): Direct ANSI SQL multi-table join queries.
- $\alpha = 0$ (Baseline): Standard unsteered model response.
- $\alpha > 0$ (Positive Steering): Python
sqlite3+pandasdata pipeline.
π 3. 10-Query Benchmark & Gemini Judge Results
Evaluated across 10 queries spanning from 2-table joins to 6-table joins:
| Query ID | Complexity | Tables | SQL Execution | SQL Rows | Python Execution | Python Rows |
|---|---|---|---|---|---|---|
q01 |
Simple | 2 | β Success | 50 | β Success | 50 |
q02 |
Simple | 2 | β Success | 5 | β Success | 5 |
q03 |
Medium | 3 | β Success | 50 | β Success | 150 |
q04 |
Medium | 3 | β Success | 10 | β Success | 0 |
q05 |
Medium | 4 | β Success | 15 | β Success | 15 |
q06 |
Complex | 4 | β Success | 0 | β Success | 0 |
q07 |
Complex | 5 | β Success | 250 | β Success | 54 |
q08 |
Complex | 5 | β Success | 0 | β Success | 0 |
q09 |
Complex | 5 | β Success | 100 | β Error | 0 |
q10 |
Very Complex | 6 | β Success | 0 | β Error | 0 |
Key Findings:
- SQL Success Rate: 100% execution success across all 10 queries.
- Neutral JSON Schema Impact: Replaced SQL DDL (
CREATE TABLE) with JSON schema metadata ({"columns": [...], "foreign_keys": {...}}), eliminating linguistic bias and allowing seamless generation of both Python scripts and SQL queries.
π 4. How to Run & Reproduce
# 1. Clone repository from Hugging Face
git clone https://huggingface.co/datasets/mayank-dubey-ai/enterprise-100-db-steering
cd enterprise-100-db-steering
# 2. Run full 1-click reproduction suite (DB generation -> vector extraction -> benchmark execution)
bash reproduce.sh
# 3. Or run fast benchmark evaluation directly
python3 fast_benchmark_eval.py
# 4. Or test interactive query steering
python3 steer_db.py --query "Fetch customer orders with user email and product name." --mode all
Published artifacts
- Steering vectors: enterprise-100-qwen3-8b-steering-vectors
- Interactive experiment explorer: Enterprise-100 DB Steering Lab
- Base model: Qwen/Qwen3-8B
The vector repository separates reusable model artifacts from this dataset and reproduction code. The free static Space exposes layer diagnostics, all saved benchmark generations, execution outcomes, and the downloadable SQLite fixture.
Optional live H100 API
api/server.py exposes the real activation intervention as an authenticated,
generation-only FastAPI service. It never executes generated SQL or Python.
pip install -r api/requirements.txt
export STEERING_API_KEY="$(openssl rand -hex 32)"
export STEERING_CORS_ORIGINS="https://mayank-dubey-ai-enterprise-100-db-steering-lab.static.hf.space"
bash api/run.sh
Endpoints:
GET /healthPOST /v1/generateβ one layer/alpha configurationPOST /v1/compareβ negative, neutral, and positive steering
Example:
curl -H "Authorization: Bearer $STEERING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"List orders with user email","strength":0.75,"layer":16}' \
http://127.0.0.1:8000/v1/compare
The current public quick-tunnel URL is temporary and has no uptime guarantee. For durable deployment, use a named Cloudflare Tunnel or a managed inference service and retain bearer authentication, concurrency limits, and request caps.
- Downloads last month
- 575