Skip to content

TWWinde/GRAIL_Compensation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Overview

GRAIL is a post-compression weight compensation framework that recovers the performance of structured compressed models. It leverages Gram matrix statistics and ridge regression to compensate for information loss without expensive retraining.

image

This repository contains implementations for:

  1. Large Language Models (LLMs): LLaMA, LLaMA-2
  2. Vision Models: ResNet, ViT, CLIP

Repository Structure

The project is organized into two main modules:

Located in grail-llm/, this module supports:

👉 Go to GRAIL-LLM Documentation

Located in grail-vision/, this module supports:

👉 Go to GRAIL-Vision Documentation

Quick Start

For LLMs

cd grail-llm
pip install -r requirements.txt  # If available, or see installation in README
python main.py --model meta-llama/Llama-2-7b-hf --prune_method flap --compensate

For Vision Models

cd grail-vision
# Follow instructions in grail-vision/README.md

Citation

If you use GRAIL in your research, please cite:

@inproceedings{Tang2026GRAIL,
  author    = {Tang, Wenwu. and Wang, Dong and Thiele, Lothar. and Saukh, Olga.},
  title     = {GRAIL: Post-hoc Compensation by Linear Reconstruction for Compressed Networks},
  booktitle = {Proceedings of the Conference on Parsimony and Learning (CPAL)},
  year      = {2026},
  note      = {Accepted (Proceedings Track)}
}

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%