Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringclasses
5 values
category
stringclasses
3 values
prompt
stringclasses
5 values
model_output
stringclasses
5 values
generation_time_sec
float64
79
112
output_token_count
int64
1.45k
1.5k
cqp_01
Constrained Quadratic Program
Minimize f(x, y) = 3*x^2 + 2*y^2 - 4*x + 6*y + 7 subject to the inequality constraint: x + 2*y >= 4 and equality constraint: 2*x - y = 1. Provide a step-by-step mathematical derivation using KKT conditions. State: (1) The Lagrangian, (2) Stationary gradients, (3) Primal/Dual feasibility, (4) Complementary slackness, an...
To solve the given problem using the Karush-Kuhn-Tucker (KKT) conditions, we need to follow these steps: ### Step 1: Formulate the Lagrangian The Lagrangian for this problem is: \[ \mathcal{L}(x, y, \lambda_1, \lambda_2) = 3x^2 + 2y^2 - 4x + 6y + 7 + \lambda_1 (x + 2y - 4) + \lambda_2 (2x - y - 1) \] ### Step 2: Com...
86.27
1,500
cqp_02
Constrained Quadratic Program
Minimize f(x1, x2) = 0.5*x1^2 + x2^2 - 2*x1 - 3*x2 subject to: x1 + x2 <= 2 and x1 >= 0, x2 >= 0. Derive the solution using KKT conditions. Show all case testing for active vs inactive inequality constraints.
To solve the given optimization problem using the Karush-Kuhn-Tucker (KKT) conditions, we need to follow these steps: ### Problem Formulation: We are given the objective function: \[ f(x_1, x_2) = \frac{1}{2}x_1^2 + x_2^2 - 2x_1 - 3x_2 \] Subject to the constraints: \[ g_1(x_1, x_2) = x_1 + x_2 - 2 \leq 0 \] \[ g_2(x...
111.82
1,500
pvm_01
Portfolio Variance Minimization
Minimize portfolio variance: sigma^2 = 2*w1^2 + 3*w2^2 + w3^2 + 2*w1*w2 subject to: 1) Target return: 0.10*w1 + 0.15*w2 + 0.08*w3 = 0.12 2) Budget constraint: w1 + w2 + w3 = 1 Derive the 5x5 system of linear equations using Lagrange multipliers. Solve the linear system step-by-step and provide exact fractional values f...
To solve this problem using the method of Lagrange multipliers, we first define our objective function \( f(w_1, w_2, w_3) = 2w_1^2 + 3w_2^2 + w_3^2 + 2w_1w_2 \) and the constraints: 1. \( g_1(w_1, w_2, w_3) = 0.10w_1 + 0.15w_2 + 0.08w_3 - 0.12 = 0 \) 2. \( g_2(w_1, w_2, w_3) = w_1 + w_2 + w_3 - 1 = 0 \) The Lagrangi...
83.93
1,500
pvm_02
Portfolio Variance Minimization
Minimize variance: sigma^2 = w1^2 + 2*w2^2 + 1.5*w3^2 subject to: w1 + w2 + w3 = 1 and 0.05*w1 + 0.10*w2 + 0.12*w3 = 0.09. Solve via matrix inversion or Gaussian elimination showing every arithmetic step.
To solve the problem of minimizing the variance \(\sigma^2 = w_1^2 + 2w_2^2 + 1.5w_3^2\) subject to the constraints \(w_1 + w_2 + w_3 = 1\) and \(0.05w_1 + 0.10w_2 + 0.12w_3 = 0.09\), we will use the method of Lagrange multipliers. First, let's define the Lagrangian function: \[ \mathcal{L}(w_1, w_2, w_3, \lambda_1, \...
84.95
1,500
nlb_01
Non-linear Boundary Optimization
Minimize f(x1, x2) = (x1 - 4)^2 + (x2 - 4)^2 subject to: g1(x): x1 + x2 <= 4 g2(x): x1 - 3*x2 <= 1 x1 >= 0, x2 >= 0 Examine all candidate boundary combinations for KKT multipliers. Verify whether mu_1 >= 0 and mu_2 >= 0 hold for each candidate point.
To solve the given constrained optimization problem using the Karush-Kuhn-Tucker (KKT) conditions, we need to follow these steps: 1. **Formulate the Lagrangian Function:** The Lagrangian function \( \mathcal{L}(x_1, x_2, \mu_1, \mu_2) \) is given by: \[ \mathcal{L}(x_1, x_2, \mu_1, \mu_2) = (x_1 - 4)^2 + (x_...
79
1,453

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Technical Challenge: Symbolic Drift & Constraint Decay in Frontier LLMs

1. Executive Summary & Background

When deploying AI for core engineering, economic, and mathematical optimization tasks (such as Karush-Kuhn-Tucker conditions or Lagrangian multipliers), calculations require rigorous multi-step invariant tracking. Drawing from practical experience building optimization pipelines, we identify an underexplored capability gap in current models: Symbolic Drift and Constraint Decay.

Unlike human analysts who maintain external working memory or strict symbolic invariants, autoregressive language models treat derivations as next-token distributions. As derivation length increases:

  • Coefficients mutate silently across intermediate paragraphs.
  • Constraints vanish or fail to enforce complementary slackness (\mu \ge 0).
  • Algebraic shortcuts mask missing intermediate arithmetic steps, leading to high residual constraint violations.

2. Systematic Evaluation Setup

  • Model Evaluated: Qwen/Qwen2.5-3B-Instruct (~3.09 Billion parameters, hosted on Hugging Face).
  • Environment: Google Colab (Free T4 GPU runtime, FP16 precision via Hugging Face Transformers & PyTorch).
  • Evaluation Suite: Custom dataset of multi-step constrained quadratic programs and portfolio risk minimization problems requiring exact rational fraction arithmetic and boundary verification.

3. Empirical Observations & Failure Modes

Problem Category Prompt Focus Observed Model Behavior Evaluation Finding
Constrained Quadratic Program KKT conditions, stationary equations, primal equality (2x - y = 1) Generated clean step-by-step algebraic derivations and correct final coordinates (x^*, y^*) = (1.2, 1.4). Arithmetic Hallucination / Drift: Detailed case-study analysis below reveals subtle arithmetic failure despite clean formatting.
Portfolio Variance Minimization 5x5 linear system solving via Lagrange multipliers Skipped explicit matrix row-reduction steps and jumped straight to final weight distribution. Algebraic Shortcut Fallacy: Final weights violated the target expected return constraint by over 14% due to skipped simultaneous equation steps.
Non-linear Boundary Optimization Active vs. inactive inequality case checking Dropped secondary inequality constraint g_2(x) \le 1 halfway through the derivation. Constraint Decay: Evaluated an interior saddle point rather than verifying true global boundary feasibility.

4. Detailed Case Study: Concrete Failure Trace Analysis (cqp_01)

To understand how the model fails under the hood, we audited the generated text for test case cqp_01:

  1. The Model's Optimal Point: The model successfully derived the coordinate candidate (x^*, y^*) = (6/5, 7/5) = (1.2, 1.4).

  2. Primal Constraint Verification:

    • Testing equality (2x - y = 1): 2(1.2) - 1.4 = 2.4 - 1.4 = 1.0 (Satisfied).
    • Testing inequality (x + 2y \ge 4): 1.2 + 2(1.4) = 1.2 + 2.8 = 4.0 (Meets boundary equality).
  3. The Smoking Gun (Arithmetic Hallucination & Symbolic Strain): When evaluating the objective function f(x, y) = 3x^2 + 2y^2 - 4x + 6y + 7 at this point using rational fractions, the model generated: [ = 3(36/25)^2 + 2(49/25)^2 - 24/5 + 42/5 + 7 ] [ = 108/25 + 98/25 - 120/25 + 210/25 + 175/25 ] [ = 491/25 = 19.64 ]

    The Audit: Summing the numerators correctly yields 108 + 98 - 120 + 210 + 175 = 471, not 491. The model suffered from a hidden arithmetic hallucination at the final summation stage while maintaining flawless linguistic and markdown formatting. This proves that models can mimic proof structures perfectly while failing multi-step arithmetic invariants.


5. Proposed Path Forward

To bridge this gap without scaling model size, we propose:

  1. Neuro-Symbolic Sandboxing (RLVR): Fine-tuning models via Reinforcement Learning with Verifiable Rewards to output executable symbolic code blocks (e.g., SymPy) for intermediate arithmetic and constraint verification.
  2. State-Tracking Attention Registers: Architectural buffers dedicated to pinning variable definitions and active inequalities across deep context windows to prevent symbolic decay.

6. Repository Artifacts

  • run_eval.py: Complete Google Colab execution script.
  • evaluation_results.json: Raw model outputs, token counts, and execution logs across all categories.
Downloads last month
42