71 KiB
71 KiB
In [1]:
import numpy as np
from pathlib import Path
import pandas as pd
# For nice table display
pd.set_option('display.precision', 4)
pd.set_option('display.max_columns', 20)In [2]:
# The 6 tasks we selected for overlap
selected_tasks = pd.DataFrame([
{'Task': 'HellaSwag 0-shot', 'GPT-3 K': 0, 'CORE K': 0, 'Match': 'Both zero-shot'},
{'Task': 'LAMBADA', 'GPT-3 K': 0, 'CORE K': 0, 'Match': 'Both zero-shot'},
{'Task': 'HellaSwag 10-shot', 'GPT-3 K': 20, 'CORE K': 10, 'Match': 'Both few-shot (K differs slightly)'},
{'Task': 'PIQA', 'GPT-3 K': 50, 'CORE K': 10, 'Match': 'Both few-shot'},
{'Task': 'ARC Easy', 'GPT-3 K': 50, 'CORE K': 10, 'Match': 'Both few-shot'},
{'Task': 'ARC Challenge', 'GPT-3 K': 50, 'CORE K': 10, 'Match': 'Both few-shot'},
])
selected_tasksOut [2]:
| Task | GPT-3 K | CORE K | Match | |
|---|---|---|---|---|
| 0 | HellaSwag 0-shot | 0 | 0 | Both zero-shot |
| 1 | LAMBADA | 0 | 0 | Both zero-shot |
| 2 | HellaSwag 10-shot | 20 | 10 | Both few-shot (K differs slightly) |
| 3 | PIQA | 50 | 10 | Both few-shot |
| 4 | ARC Easy | 50 | 10 | Both few-shot |
| 5 | ARC Challenge | 50 | 10 | Both few-shot |
In [3]:
# Random baselines for centering (from CORE specification)
BASELINES = {
'hellaswag_zeroshot': 0.25,
'lambada_openai': 0.0,
'hellaswag': 0.25,
'piqa': 0.50,
'arc_easy': 0.25,
'arc_challenge': 0.25,
}
TASK_ORDER = ['hellaswag_zeroshot', 'lambada_openai', 'hellaswag', 'piqa', 'arc_easy', 'arc_challenge']
TASK_NAMES = ['HellaSwag 0-shot', 'LAMBADA', 'HellaSwag 10-shot', 'PIQA', 'ARC Easy', 'ARC Challenge']
def center_accuracy(acc, baseline):
"""Convert raw accuracy to centered accuracy."""
return (acc - baseline) / (1.0 - baseline)
def parse_csv(filepath):
"""Parse a CORE results CSV file."""
results = {}
with open(filepath) as f:
for line in f:
parts = [p.strip() for p in line.strip().split(',')]
if len(parts) >= 3 and parts[0] != 'Task':
task = parts[0]
try:
acc = float(parts[1]) if parts[1] else None
centered = float(parts[2]) if parts[2] else None
results[task] = {'accuracy': acc, 'centered': centered}
except ValueError:
pass
return resultsIn [4]:
# Load GPT-2 CORE results
knowledge_dir = Path("/home/ubuntu/.cache/nanochat/eval_bundle")
gpt2_models = [
('GPT-2', 'openai-community-gpt2.csv', 124e6),
('GPT-2 Medium', 'openai-community-gpt2-medium.csv', 355e6),
('GPT-2 Large', 'openai-community-gpt2-large.csv', 774e6),
('GPT-2 XL', 'openai-community-gpt2-xl.csv', 1558e6),
]
gpt2_data = []
for name, filename, params in gpt2_models:
results = parse_csv(knowledge_dir / filename)
core = results['CORE']['centered']
task_accs = [results[task]['accuracy'] for task in TASK_ORDER]
gpt2_data.append({
'name': name,
'params': params,
'task_accs': task_accs,
'core': core,
})
# Display as DataFrame
gpt2_df = pd.DataFrame([
{
'Model': d['name'],
'Params': f"{d['params']/1e6:.0f}M",
**{name: f"{acc:.1%}" for name, acc in zip(TASK_NAMES, d['task_accs'])},
'CORE': f"{d['core']:.4f}"
}
for d in gpt2_data
])
print("GPT-2 Family: Raw Accuracies and CORE Scores")
gpt2_dfOut [4]:
GPT-2 Family: Raw Accuracies and CORE Scores
| Model | Params | HellaSwag 0-shot | LAMBADA | HellaSwag 10-shot | PIQA | ARC Easy | ARC Challenge | CORE | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | GPT-2 | 124M | 30.9% | 32.3% | 30.8% | 62.3% | 41.2% | 22.2% | 0.1139 |
| 1 | GPT-2 Medium | 355M | 39.0% | 42.6% | 39.5% | 67.0% | 48.0% | 26.2% | 0.1849 |
| 2 | GPT-2 Large | 774M | 44.0% | 48.8% | 44.4% | 69.8% | 53.5% | 26.4% | 0.2146 |
| 3 | GPT-2 XL | 1558M | 50.2% | 52.3% | 51.2% | 72.5% | 59.5% | 29.9% | 0.2565 |
In [5]:
# Build feature matrix (centered accuracies)
X_gpt2 = []
y_gpt2 = []
for data in gpt2_data:
centered_accs = []
for task, acc in zip(TASK_ORDER, data['task_accs']):
centered = center_accuracy(acc, BASELINES[task])
centered_accs.append(centered)
X_gpt2.append(centered_accs)
y_gpt2.append(data['core'])
X_gpt2 = np.array(X_gpt2)
y_gpt2 = np.array(y_gpt2)
# Display centered accuracies
centered_df = pd.DataFrame(
X_gpt2,
columns=TASK_NAMES,
index=[d['name'] for d in gpt2_data]
)
centered_df['Mean'] = X_gpt2.mean(axis=1)
centered_df['CORE'] = y_gpt2
print("GPT-2 Family: Centered Accuracies")
centered_dfOut [5]:
GPT-2 Family: Centered Accuracies
| HellaSwag 0-shot | LAMBADA | HellaSwag 10-shot | PIQA | ARC Easy | ARC Challenge | Mean | CORE | |
|---|---|---|---|---|---|---|---|---|
| GPT-2 | 0.0780 | 0.3229 | 0.0772 | 0.2459 | 0.2166 | -0.0375 | 0.1505 | 0.1139 |
| GPT-2 Medium | 0.1867 | 0.4260 | 0.1933 | 0.3400 | 0.3067 | 0.0160 | 0.2448 | 0.1849 |
| GPT-2 Large | 0.2533 | 0.4880 | 0.2587 | 0.3960 | 0.3800 | 0.0187 | 0.2991 | 0.2146 |
| GPT-2 XL | 0.3360 | 0.5230 | 0.3493 | 0.4500 | 0.4600 | 0.0653 | 0.3639 | 0.2565 |
In [6]:
# GPT-3 accuracies from the paper
# Format: [hellaswag_0shot, lambada_0shot, hellaswag_fewshot, piqa_fewshot, arc_easy_fewshot, arc_challenge_fewshot]
gpt3_models = [
('GPT-3 Small', 125e6, [0.337, 0.427, 0.335, 0.643, 0.427, 0.255]),
('GPT-3 Medium', 350e6, [0.436, 0.543, 0.431, 0.694, 0.510, 0.284]),
('GPT-3 Large', 760e6, [0.510, 0.604, 0.513, 0.720, 0.581, 0.323]),
('GPT-3 XL', 1.3e9, [0.547, 0.636, 0.549, 0.743, 0.591, 0.367]),
('GPT-3 2.7B', 2.7e9, [0.628, 0.671, 0.629, 0.754, 0.621, 0.395]),
('GPT-3 6.7B', 6.7e9, [0.674, 0.703, 0.673, 0.778, 0.658, 0.437]),
('GPT-3 13B', 13e9, [0.709, 0.725, 0.713, 0.799, 0.691, 0.448]),
('GPT-3 175B', 175e9, [0.789, 0.762, 0.793, 0.823, 0.701, 0.515]),
]
# Display raw accuracies
gpt3_df = pd.DataFrame([
{
'Model': name,
'Params': f"{params/1e9:.1f}B" if params >= 1e9 else f"{params/1e6:.0f}M",
**{task_name: f"{acc:.1%}" for task_name, acc in zip(TASK_NAMES, accs)}
}
for name, params, accs in gpt3_models
])
print("GPT-3 Family: Raw Accuracies from Paper")
gpt3_dfOut [6]:
GPT-3 Family: Raw Accuracies from Paper
| Model | Params | HellaSwag 0-shot | LAMBADA | HellaSwag 10-shot | PIQA | ARC Easy | ARC Challenge | |
|---|---|---|---|---|---|---|---|---|
| 0 | GPT-3 Small | 125M | 33.7% | 42.7% | 33.5% | 64.3% | 42.7% | 25.5% |
| 1 | GPT-3 Medium | 350M | 43.6% | 54.3% | 43.1% | 69.4% | 51.0% | 28.4% |
| 2 | GPT-3 Large | 760M | 51.0% | 60.4% | 51.3% | 72.0% | 58.1% | 32.3% |
| 3 | GPT-3 XL | 1.3B | 54.7% | 63.6% | 54.9% | 74.3% | 59.1% | 36.7% |
| 4 | GPT-3 2.7B | 2.7B | 62.8% | 67.1% | 62.9% | 75.4% | 62.1% | 39.5% |
| 5 | GPT-3 6.7B | 6.7B | 67.4% | 70.3% | 67.3% | 77.8% | 65.8% | 43.7% |
| 6 | GPT-3 13B | 13.0B | 70.9% | 72.5% | 71.3% | 79.9% | 69.1% | 44.8% |
| 7 | GPT-3 175B | 175.0B | 78.9% | 76.2% | 79.3% | 82.3% | 70.1% | 51.5% |
In [7]:
# Compute centered accuracies for GPT-3
X_gpt3 = []
for name, params, accs in gpt3_models:
centered_accs = [center_accuracy(acc, BASELINES[task]) for task, acc in zip(TASK_ORDER, accs)]
X_gpt3.append(centered_accs)
X_gpt3 = np.array(X_gpt3)
# Display
gpt3_centered_df = pd.DataFrame(
X_gpt3,
columns=TASK_NAMES,
index=[m[0] for m in gpt3_models]
)
gpt3_centered_df['Mean'] = X_gpt3.mean(axis=1)
print("GPT-3 Family: Centered Accuracies")
gpt3_centered_dfOut [7]:
GPT-3 Family: Centered Accuracies
| HellaSwag 0-shot | LAMBADA | HellaSwag 10-shot | PIQA | ARC Easy | ARC Challenge | Mean | |
|---|---|---|---|---|---|---|---|
| GPT-3 Small | 0.1160 | 0.427 | 0.1133 | 0.286 | 0.2360 | 0.0067 | 0.1975 |
| GPT-3 Medium | 0.2480 | 0.543 | 0.2413 | 0.388 | 0.3467 | 0.0453 | 0.3021 |
| GPT-3 Large | 0.3467 | 0.604 | 0.3507 | 0.440 | 0.4413 | 0.0973 | 0.3800 |
| GPT-3 XL | 0.3960 | 0.636 | 0.3987 | 0.486 | 0.4547 | 0.1560 | 0.4212 |
| GPT-3 2.7B | 0.5040 | 0.671 | 0.5053 | 0.508 | 0.4947 | 0.1933 | 0.4794 |
| GPT-3 6.7B | 0.5653 | 0.703 | 0.5640 | 0.556 | 0.5440 | 0.2493 | 0.5303 |
| GPT-3 13B | 0.6120 | 0.725 | 0.6173 | 0.598 | 0.5880 | 0.2640 | 0.5674 |
| GPT-3 175B | 0.7187 | 0.762 | 0.7240 | 0.646 | 0.6013 | 0.3533 | 0.6342 |
In [8]:
def simple_linear_regression(x, y):
"""Simple 1D linear regression: y = a*x + b"""
mean_x, mean_y = np.mean(x), np.mean(y)
a = np.sum((x - mean_x) * (y - mean_y)) / np.sum((x - mean_x) ** 2)
b = mean_y - a * mean_x
return a, b
def ridge_regression(X, y, alpha=0.1):
"""
Ridge regression: minimize ||Xw - y||² + α||w||²
We don't regularize the intercept.
"""
n_samples, n_features = X.shape
X_aug = np.column_stack([np.ones(n_samples), X])
reg_matrix = alpha * np.eye(n_features + 1)
reg_matrix[0, 0] = 0 # Don't regularize intercept
coeffs = np.linalg.solve(X_aug.T @ X_aug + reg_matrix, X_aug.T @ y)
return coeffs[0], coeffs[1:] # intercept, weights
def compute_r_squared(y_true, y_pred):
"""Compute R² score."""
ss_res = np.sum((y_true - y_pred) ** 2)
ss_tot = np.sum((y_true - np.mean(y_true)) ** 2)
return 1 - ss_res / ss_totIn [9]:
# Compute average of 6 centered accuracies
avg_centered_gpt2 = X_gpt2.mean(axis=1)
# Fit linear regression
slope, intercept = simple_linear_regression(avg_centered_gpt2, y_gpt2)
print(f"Simple Model: CORE = {slope:.4f} × avg_centered + {intercept:.4f}")
# Validate
y_pred_simple = slope * avg_centered_gpt2 + intercept
r2_simple = compute_r_squared(y_gpt2, y_pred_simple)
validation_df = pd.DataFrame({
'Model': [d['name'] for d in gpt2_data],
'Avg Centered': avg_centered_gpt2,
'Predicted': y_pred_simple,
'Actual': y_gpt2,
'Error': y_pred_simple - y_gpt2
})
print(f"\nR² = {r2_simple:.4f}")
validation_dfOut [9]:
Simple Model: CORE = 0.6639 × avg_centered + 0.0168 R² = 0.9960
| Model | Avg Centered | Predicted | Actual | Error | |
|---|---|---|---|---|---|
| 0 | GPT-2 | 0.1505 | 0.1168 | 0.1139 | 0.0029 |
| 1 | GPT-2 Medium | 0.2448 | 0.1793 | 0.1849 | -0.0056 |
| 2 | GPT-2 Large | 0.2991 | 0.2154 | 0.2146 | 0.0008 |
| 3 | GPT-2 XL | 0.3639 | 0.2584 | 0.2565 | 0.0019 |
In [10]:
# Try different regularization strengths
alphas = [0.0, 0.001, 0.01, 0.1, 1.0]
results = []
for alpha in alphas:
intercept_r, weights = ridge_regression(X_gpt2, y_gpt2, alpha=alpha)
y_pred = X_gpt2 @ weights + intercept_r
r2 = compute_r_squared(y_gpt2, y_pred)
weight_norm = np.sqrt(np.sum(weights ** 2))
results.append({
'α': alpha,
'R²': r2,
'||weights||': weight_norm,
'Intercept': intercept_r,
'Weights': weights.copy()
})
alpha_df = pd.DataFrame([{k: v for k, v in r.items() if k != 'Weights'} for r in results])
print("Effect of Regularization Strength:")
alpha_dfOut [10]:
Effect of Regularization Strength:
| α | R² | ||weights|| | Intercept | |
|---|---|---|---|---|
| 0 | 0.000 | 1.0000 | 10.7221 | -0.0829 |
| 1 | 0.001 | 0.9971 | 0.2796 | 0.0159 |
| 2 | 0.010 | 0.9916 | 0.2463 | 0.0269 |
| 3 | 0.100 | 0.8448 | 0.1600 | 0.0851 |
| 4 | 1.000 | 0.2523 | 0.0356 | 0.1686 |
In [11]:
# Show weights for each alpha
print("Task Weights by Regularization Strength:")
weights_df = pd.DataFrame(
[r['Weights'] for r in results],
columns=TASK_NAMES,
index=[f"α={r['α']}" for r in results]
)
weights_dfOut [11]:
Task Weights by Regularization Strength:
| HellaSwag 0-shot | LAMBADA | HellaSwag 10-shot | PIQA | ARC Easy | ARC Challenge | |
|---|---|---|---|---|---|---|
| α=0.0 | 6.5523 | 0.2201 | -8.0268 | 0.5378 | 0.9109 | 2.5364 |
| α=0.001 | 0.1134 | 0.1442 | 0.1305 | 0.1153 | 0.0510 | 0.1079 |
| α=0.01 | 0.1155 | 0.1000 | 0.1226 | 0.0959 | 0.1023 | 0.0513 |
| α=0.1 | 0.0759 | 0.0614 | 0.0798 | 0.0610 | 0.0714 | 0.0293 |
| α=1.0 | 0.0169 | 0.0136 | 0.0178 | 0.0135 | 0.0160 | 0.0064 |
In [12]:
# Use α=0.01 as our chosen regularization
# This gives R²≈0.99 with reasonable, stable weights (~0.1 each task)
CHOSEN_ALPHA = 0.01
intercept_ridge, weights_ridge = ridge_regression(X_gpt2, y_gpt2, alpha=CHOSEN_ALPHA)
print(f"Ridge Model (α={CHOSEN_ALPHA}):")
print(f" Intercept: {intercept_ridge:.4f}")
print(f" Weights:")
for name, w in zip(TASK_NAMES, weights_ridge):
print(f" {name:20s}: {w:+.4f}")
# Validate
y_pred_ridge = X_gpt2 @ weights_ridge + intercept_ridge
r2_ridge = compute_r_squared(y_gpt2, y_pred_ridge)
print(f"\nR² = {r2_ridge:.4f}")Ridge Model (α=0.01):
Intercept: 0.0269
Weights:
HellaSwag 0-shot : +0.1155
LAMBADA : +0.1000
HellaSwag 10-shot : +0.1226
PIQA : +0.0959
ARC Easy : +0.1023
ARC Challenge : +0.0513
R² = 0.9916
In [13]:
# Fit separate linear regression for each task
individual_results = []
for i, task_name in enumerate(TASK_NAMES):
x_task = X_gpt2[:, i]
slope_ind, intercept_ind = simple_linear_regression(x_task, y_gpt2)
y_pred_ind = slope_ind * x_task + intercept_ind
r2_ind = compute_r_squared(y_gpt2, y_pred_ind)
individual_results.append({
'Task': task_name,
'R²': r2_ind,
'Slope': slope_ind,
'Intercept': intercept_ind
})
individual_df = pd.DataFrame(individual_results).sort_values('R²', ascending=False)
print("Individual Task Correlations with CORE:")
individual_dfOut [13]:
Individual Task Correlations with CORE:
| Task | R² | Slope | Intercept | |
|---|---|---|---|---|
| 3 | PIQA | 0.9961 | 0.6879 | -0.0537 |
| 2 | HellaSwag 10-shot | 0.9933 | 0.5230 | 0.0776 |
| 0 | HellaSwag 0-shot | 0.9927 | 0.5489 | 0.0753 |
| 1 | LAMBADA | 0.9841 | 0.6792 | -0.1063 |
| 4 | ARC Easy | 0.9800 | 0.5728 | -0.0027 |
| 5 | ARC Challenge | 0.9599 | 1.3994 | 0.1706 |
In [14]:
# Apply all three approaches
avg_centered_gpt3 = X_gpt3.mean(axis=1)
gpt3_core_simple = slope * avg_centered_gpt3 + intercept
gpt3_core_ridge = X_gpt3 @ weights_ridge + intercept_ridge
# Approach 3: Best individual predictor (PIQA)
piqa_idx = TASK_NAMES.index('PIQA')
piqa_model = [r for r in individual_results if r['Task'] == 'PIQA'][0]
gpt3_core_piqa = piqa_model['Slope'] * X_gpt3[:, piqa_idx] + piqa_model['Intercept']
# Average of approaches 1 and 2
gpt3_core_final = (gpt3_core_simple + gpt3_core_ridge) / 2
# Create results table with all approaches
results_df = pd.DataFrame({
'Model': [m[0] for m in gpt3_models],
'Params': [f"{m[1]/1e9:.1f}B" if m[1] >= 1e9 else f"{m[1]/1e6:.0f}M" for m in gpt3_models],
'Simple': gpt3_core_simple,
f'Ridge': gpt3_core_ridge,
'PIQA only': gpt3_core_piqa,
'Avg(1,2)': gpt3_core_final
})
print("GPT-3 CORE Estimates (all three approaches):")
results_dfOut [14]:
GPT-3 CORE Estimates (all three approaches):
| Model | Params | Simple | Ridge | PIQA only | Avg(1,2) | |
|---|---|---|---|---|---|---|
| 0 | GPT-3 Small | 125M | 0.1480 | 0.1488 | 0.1430 | 0.1484 |
| 1 | GPT-3 Medium | 350M | 0.2174 | 0.2144 | 0.2131 | 0.2159 |
| 2 | GPT-3 Large | 760M | 0.2691 | 0.2627 | 0.2489 | 0.2659 |
| 3 | GPT-3 XL | 1.3B | 0.2965 | 0.2862 | 0.2805 | 0.2914 |
| 4 | GPT-3 2.7B | 2.7B | 0.3351 | 0.3234 | 0.2957 | 0.3292 |
| 5 | GPT-3 6.7B | 6.7B | 0.3689 | 0.3534 | 0.3287 | 0.3611 |
| 6 | GPT-3 13B | 13.0B | 0.3935 | 0.3768 | 0.3576 | 0.3852 |
| 7 | GPT-3 175B | 175.0B | 0.4379 | 0.4164 | 0.3906 | 0.4272 |
In [15]:
# Combine with GPT-2 for complete picture
all_models = []
for data in gpt2_data:
params = data['params']
all_models.append({
'Model': data['name'],
'Family': 'GPT-2',
'Params': params,
'Params_str': f"{params/1e9:.1f}B" if params >= 1e9 else f"{params/1e6:.0f}M",
'CORE': data['core'],
'Source': 'Measured'
})
for (name, params, _), core in zip(gpt3_models, gpt3_core_final):
all_models.append({
'Model': name,
'Family': 'GPT-3',
'Params': params,
'Params_str': f"{params/1e9:.1f}B" if params >= 1e9 else f"{params/1e6:.0f}M",
'CORE': core,
'Source': 'Estimated'
})
# Sort by params and display
all_models.sort(key=lambda x: x['Params'])
final_df = pd.DataFrame(all_models)[['Model', 'Params_str', 'CORE', 'Source']]
final_df.columns = ['Model', 'Params', 'CORE', 'Source']
print("Complete CORE Scores (GPT-2 measured, GPT-3 estimated):")
final_dfOut [15]:
Complete CORE Scores (GPT-2 measured, GPT-3 estimated):
| Model | Params | CORE | Source | |
|---|---|---|---|---|
| 0 | GPT-2 | 124M | 0.1139 | Measured |
| 1 | GPT-3 Small | 125M | 0.1484 | Estimated |
| 2 | GPT-3 Medium | 350M | 0.2159 | Estimated |
| 3 | GPT-2 Medium | 355M | 0.1849 | Measured |
| 4 | GPT-3 Large | 760M | 0.2659 | Estimated |
| 5 | GPT-2 Large | 774M | 0.2146 | Measured |
| 6 | GPT-3 XL | 1.3B | 0.2914 | Estimated |
| 7 | GPT-2 XL | 1.6B | 0.2565 | Measured |
| 8 | GPT-3 2.7B | 2.7B | 0.3292 | Estimated |
| 9 | GPT-3 6.7B | 6.7B | 0.3611 | Estimated |
| 10 | GPT-3 13B | 13.0B | 0.3852 | Estimated |
| 11 | GPT-3 175B | 175.0B | 0.4272 | Estimated |
In [16]:
comparisons = [
('~125M', 'GPT-2', gpt2_data[0]['core'], 'GPT-3 Small', gpt3_core_final[0]),
('~350M', 'GPT-2 Medium', gpt2_data[1]['core'], 'GPT-3 Medium', gpt3_core_final[1]),
('~760M', 'GPT-2 Large', gpt2_data[2]['core'], 'GPT-3 Large', gpt3_core_final[2]),
('~1.3-1.5B', 'GPT-2 XL', gpt2_data[3]['core'], 'GPT-3 XL', gpt3_core_final[3]),
]
comparison_df = pd.DataFrame([
{
'Size': size,
'GPT-2 CORE': gpt2_core,
'GPT-3 CORE': gpt3_core,
'Δ': gpt3_core - gpt2_core,
'Improvement': f"{100 * (gpt3_core - gpt2_core) / gpt2_core:+.1f}%"
}
for size, _, gpt2_core, _, gpt3_core in comparisons
])
print("GPT-3 vs GPT-2 at Similar Model Sizes:")
comparison_dfOut [16]:
GPT-3 vs GPT-2 at Similar Model Sizes:
| Size | GPT-2 CORE | GPT-3 CORE | Δ | Improvement | |
|---|---|---|---|---|---|
| 0 | ~125M | 0.1139 | 0.1484 | 0.0345 | +30.3% |
| 1 | ~350M | 0.1849 | 0.2159 | 0.0310 | +16.8% |
| 2 | ~760M | 0.2146 | 0.2659 | 0.0512 | +23.9% |
| 3 | ~1.3-1.5B | 0.2565 | 0.2914 | 0.0348 | +13.6% |
In [17]:
# Export as a simple dict for use elsewhere
gpt3_core_estimates = {
'GPT-3 Small (125M)': round(gpt3_core_final[0], 4),
'GPT-3 Medium (350M)': round(gpt3_core_final[1], 4),
'GPT-3 Large (760M)': round(gpt3_core_final[2], 4),
'GPT-3 XL (1.3B)': round(gpt3_core_final[3], 4),
'GPT-3 2.7B': round(gpt3_core_final[4], 4),
'GPT-3 6.7B': round(gpt3_core_final[5], 4),
'GPT-3 13B': round(gpt3_core_final[6], 4),
'GPT-3 175B': round(gpt3_core_final[7], 4),
}
print("GPT-3 CORE Estimates (for copy-paste):")
import json
print(json.dumps(gpt3_core_estimates, indent=4))GPT-3 CORE Estimates (for copy-paste):
{
"GPT-3 Small (125M)": 0.1484,
"GPT-3 Medium (350M)": 0.2159,
"GPT-3 Large (760M)": 0.2659,
"GPT-3 XL (1.3B)": 0.2914,
"GPT-3 2.7B": 0.3292,
"GPT-3 6.7B": 0.3611,
"GPT-3 13B": 0.3852,
"GPT-3 175B": 0.4272
}
In [ ]: