marwanabdelhameed/Reasoning-vs-InfernceScaling

Research Paper (https://arxiv.org/pdf/2412.16260)

0

stars

8

commits

Python

primary language

Dec 17, 2024

updated

arxiv.org/pdf/2412.16260

README

Reasoning-vs-InfernceScaling

This repository contains code to test reasoning capabilities using the Quiet Star model and inference scaling laws with Rebase. Experiments were conducted using:

  • 1 A100 GPU
  • 8 CPUs

The main purpose of this was to implemnt infernce scaling into a reasoning model (quietstar eval/quiet-rebase.py), but ended up producing worse results than the base model.

To install required libraries

pip install -r requirements.txt

Configuration Settings

General Configuration

ParameterValue
Temperature1.0
Max Tokens384
Random Seed42

REBASE Configuration

ParameterValue
Softmax Temperature0.2
Tree Width Options3, 6, 16

Note: Random seed 42 was maintained from the original QuietSTaR implementation to ensure comparable results.

Repository Contents

The repository includes:

  • base.py: Evaluates the base Mistral-7B model for:
    • Accuracy
    • Inference time
    • FLOPS per inference
  • rebase.py: Same metrics using Rebase for inference optimization
    • Note: To run rebase.py, modify the hyperparameters in rebase.yaml first
  • quietstar eval/quietstar.py: Same metrics for Quiet Star model
    • Note: To run quietstar you need to have the custom modeling_mistral and config files in the same directory as the evaluation script
  • quietstar eval/quiet-rebase.py: Same metrics using rebase inference with quiet-star model
    • Note: To run quietstar you need to have the custom modeling_mistral and config files in the same directory as the evaluation script

Results folder

The results contain results for basline Mistral7b model, quietstar, rebase with 3,6,and 16 width tree

The evaluation was performed on 128 questions from the GSM8K dataset.

For rebase we conducted different experiments with varying width sizes of the Rebase tree: 3, 6, and 16 (16 was the original width size from the paper).

Efficiency Metrics & Rankings

Equations

  1. Accuracy per TFLOP = Accuracy (%) / FLOPs (Trillion)
  2. Accuracy per Second = Accuracy (%) / Time (seconds)
  3. Efficiency Score = (Accuracy per TFLOP × Accuracy per Second) × 100

Results

ModelAccuracy (%)FLOPs (T)Time (s)Acc/TFLOPAcc/SecondEfficiency Score
Baseline10.1611.2252.470.910.1917.29
QuietSTaR32.0312.73554.662.520.0615.12
REBASE+QuietSTaR9.384.25143.662.210.0715.47
REBASE (w=3)10.942.358.474.661.29601.14
REBASE (w=6)10.164.9617.822.050.57116.85
REBASE (w=16)12.5013.5746.900.920.2724.84

Example Calculation (REBASE w=3)

  1. Accuracy per TFLOP = 10.94% / 2.35T = 4.66
  2. Accuracy per Second = 10.94% / 8.47s = 1.29
  3. Efficiency Score = (4.66 × 1.29) × 100 = 601.14

Contributors

marwanabdelhameed/Reasoning-vs-InfernceScaling

Research Paper (https://arxiv.org/pdf/2412.16260)

0

stars

8

commits

Python

primary language

Dec 17, 2024

updated

arxiv.org/pdf/2412.16260

README

Reasoning-vs-InfernceScaling

This repository contains code to test reasoning capabilities using the Quiet Star model and inference scaling laws with Rebase. Experiments were conducted using:

  • 1 A100 GPU
  • 8 CPUs

The main purpose of this was to implemnt infernce scaling into a reasoning model (quietstar eval/quiet-rebase.py), but ended up producing worse results than the base model.

To install required libraries

pip install -r requirements.txt

Configuration Settings

General Configuration

ParameterValue
Temperature1.0
Max Tokens384
Random Seed42

REBASE Configuration

ParameterValue
Softmax Temperature0.2
Tree Width Options3, 6, 16

Note: Random seed 42 was maintained from the original QuietSTaR implementation to ensure comparable results.

Repository Contents

The repository includes:

  • base.py: Evaluates the base Mistral-7B model for:
    • Accuracy
    • Inference time
    • FLOPS per inference
  • rebase.py: Same metrics using Rebase for inference optimization
    • Note: To run rebase.py, modify the hyperparameters in rebase.yaml first
  • quietstar eval/quietstar.py: Same metrics for Quiet Star model
    • Note: To run quietstar you need to have the custom modeling_mistral and config files in the same directory as the evaluation script
  • quietstar eval/quiet-rebase.py: Same metrics using rebase inference with quiet-star model
    • Note: To run quietstar you need to have the custom modeling_mistral and config files in the same directory as the evaluation script

Results folder

The results contain results for basline Mistral7b model, quietstar, rebase with 3,6,and 16 width tree

The evaluation was performed on 128 questions from the GSM8K dataset.

For rebase we conducted different experiments with varying width sizes of the Rebase tree: 3, 6, and 16 (16 was the original width size from the paper).

Efficiency Metrics & Rankings

Equations

  1. Accuracy per TFLOP = Accuracy (%) / FLOPs (Trillion)
  2. Accuracy per Second = Accuracy (%) / Time (seconds)
  3. Efficiency Score = (Accuracy per TFLOP × Accuracy per Second) × 100

Results

ModelAccuracy (%)FLOPs (T)Time (s)Acc/TFLOPAcc/SecondEfficiency Score
Baseline10.1611.2252.470.910.1917.29
QuietSTaR32.0312.73554.662.520.0615.12
REBASE+QuietSTaR9.384.25143.662.210.0715.47
REBASE (w=3)10.942.358.474.661.29601.14
REBASE (w=6)10.164.9617.822.050.57116.85
REBASE (w=16)12.5013.5746.900.920.2724.84

Example Calculation (REBASE w=3)

  1. Accuracy per TFLOP = 10.94% / 2.35T = 4.66
  2. Accuracy per Second = 10.94% / 8.47s = 1.29
  3. Efficiency Score = (4.66 × 1.29) × 100 = 601.14

Contributors

Languages

Python

100.0%