LPZero: Language Model Zero-cost Proxy Search from Zero

Peijie Dong, Lujun Li, Xiang Liu, Zhenheng Tang, Xuebo Liu, Qiang Wang, Xiaowen Chu

Abstract

Neural Architecture Search (NAS) for Large Language Models (LLMs) is often hindered by extreme computational costs. Zero-cost (ZC) proxies provide a training-free alternative for model evaluation, yet existing proxies are largely handcrafted for convolutional networks and generalize poorly to Transformers. We introduce LPZero, the first framework to automatically discover ZC proxies specifically for LLMs. By formulating proxy discovery as a symbolic regression problem and employing genetic programming with a novel rule-based pruning strategy, LPZero identifies symbolic equations that significantly outperform traditional handcrafted metrics.

Introduction

The rapid advancement of Large Language Models (LLMs) has made Neural Architecture Search (NAS) increasingly vital but computationally prohibitive. Traditional NAS requires training thousands of candidate models to evaluate their performance. Zero-shot NAS attempts to mitigate this by using Zero-cost (ZC) proxies—metrics computed at initialization with minimal compute. However, standard proxies like SNIP or Synflow, designed for computer vision, often fail to surpass simple baselines like parameter counting when applied to Transformers. LPZero addresses this gap by automating the design of ZC proxies from scratch, moving beyond human intuition to discover complex symbolic formulas tailored for LLM architectures.

Methods

LPZero treats the discovery of a ZC proxy as a symbolic regression task, searching for optimal mathematical expressions within a vast functional space.

Unified Search Space and Evolutionary Pipeline

The framework defines a comprehensive search space where a proxy $\varphi(f, g, \theta)$ is a symbolic equation. This equation is composed of six primary input types derived from the model: Activation ($A$), Jacobian ($J$), Gradient ($G$), Attention Head ($H$), Weight ($W$), and Softmax ($S$). These inputs are processed through a set of mathematical primitives, including 20 unary operations (e.g., $log$, $exp$, $sqrt$) and 4 binary operations (e.g., $+$, $-$, $\times$, $\odot$).

Overview of the LPZero framework, illustrating the symbolic search space (left) and the evolutionary search pipeline (right).

Genetic Programming (GP)

LPZero utilizes an evolutionary approach to navigate the search space. It maintains a population of proxy formulas that undergo iterative improvement through tournament selection. New candidate proxies (offspring) are generated via two primary mechanisms:

  • Crossover: Swapping sub-trees between two parent formulas to combine beneficial traits.
  • Mutation: Randomly altering a node or sub-tree within a formula to introduce structural diversity.
Detailed view of the crossover and mutation operations used to evolve symbolic proxy equations.

Rule-based Pruning Strategy (RPS)

A key challenge in symbolic search is the presence of redundant or mathematically invalid expressions (e.g., $log(exp(x))$ or divisions by zero). LPZero introduces a Rule-based Pruning Strategy (RPS) to filter these "unpromising" candidates before evaluation. By enforcing mathematical logic and eliminating identity operations, RPS prevents proxy degradation and ensures the evolutionary process focuses on meaningful symbolic compositions.

Experimental Evaluation

The effectiveness of LPZero was validated across three distinct benchmarks:

  1. FlexiBERT: A diverse set of 500 BERT-like architectures.
  2. GPT-2 Benchmark: 200 architectures evaluated on the WikiText-103 dataset.
  3. LLaMA-7B Pruning: Using discovered proxies to guide the structured pruning of a LLaMA-7B model, evaluated on 11 commonsense reasoning tasks (e.g., BoolQ, ARC, HellaSwag).

Key Results

LPZero demonstrates significant improvements over both handcrafted proxies and baseline metrics:

  • Ranking Accuracy: On FlexiBERT, LPZero achieved a Spearman’s $\rho$ of 0.748, outperforming the best handcrafted proxy (EZNAS, 0.698) and standard metrics like SNIP (0.173). On GPT-2, it reached a near-perfect correlation of 0.980.
  • Zero-Shot Pruning: When applied to LLaMA-7B, LPZero-guided pruning outperformed state-of-the-art methods like FLAP and LLM-Pruner. It achieved an average score of 64.18 across reasoning tasks without any post-pruning retraining.
  • Search Efficiency: The entire automated search for a task-specific proxy requires only approximately 10 GPU hours, representing a massive reduction in compute compared to traditional NAS.

Conclusion

LPZero represents a significant step toward fully automated and efficient LLM design. By leveraging genetic programming and rigorous pruning, it discovers zero-cost proxies that capture the unique dynamics of Transformer architectures far better than human-designed alternatives. Future work may involve expanding the search space to include second-order derivatives (Hessians) and exploring generalization to non-Transformer architectures.

Summary updated

BibTeX
@inproceedings{dong2024lpzero,
  author = {Peijie Dong and Lujun Li and Xiang Liu and Zhenheng Tang and Xuebo Liu and Qiang Wang and Xiaowen Chu},
  title = {{LPZero: Language Model Zero-cost Proxy Search from Zero}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.502},
}
Figure