Views
No views yet
ScalingLawForecaster class can be found in the GitHub repository.1import torch
2from transformers import AutoTokenizer
3# Get ScalingLawForecaster from: https://github.com/zhqwqwq/Configuration-to-Performance-Scaling-Law
4from model import ScalingLawForecaster
5
6# Load model
7model = ScalingLawForecaster(
8 base_model_name="Qwen/Qwen3-1.7B",
9 init_from_pretrained=True,
10 force_fp32=True
11)
12
13# Load checkpoint
14checkpoint = torch.load("pytorch_model.bin")
15model.load_state_dict(checkpoint["model_state_dict"])
16model.eval()
17
18# Load tokenizer
19tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-1.7B")
20
21# Prepare inputs
22# input_ids: tokenized text sequence
23# is_number_mask: boolean mask indicating which tokens are numeric
24# number_values_filled: actual numeric values (0 for non-numeric tokens)
25
26with torch.no_grad():
27 predictions = model(
28 input_ids=input_ids,
29 is_number_mask=is_number_mask,
30 number_values_filled=number_values_filled,
31 attention_mask=attention_mask
32 )1@article{ncpl2026,
2 title = {Neural Configuration to Performance Scaling Law},
3 author = {Huaqing Zhang and Kaiyue Wen and Tengyu Ma},
4 journal = {arXiv preprint arXiv:2602.10300},
5 year = {2026},
6 url = {https://www.arxiv.org/abs/2602.10300}
7}