URIAL  by Re-Align

ICL method for LLM alignment, no tuning required

created 1 year ago
311 stars

Top 87.6% on sourcepulse

GitHubView on GitHub
Project Summary

URIAL (Untuned LLMs with Restyled In-context Alignment) is a tuning-free method for aligning Large Language Models (LLMs) using only in-context learning (ICL). It targets researchers and practitioners seeking to understand and implement LLM alignment without the computational cost of fine-tuning, offering a strong baseline and interpretable approach.

How It Works

URIAL achieves alignment by providing a base LLM with a system prompt and a few (K=1 to 8) stylistic examples within the context window. This approach leverages the LLM's inherent ICL capabilities to guide its behavior, effectively mimicking the outcomes of fine-tuning-based alignment methods with significantly less overhead. The method's advantage lies in its simplicity, speed, and the ability to study alignment phenomena in a controlled, parameter-free manner.

Quick Start & Requirements

  • Installation: Requires conda for environment setup. Install vllm and other dependencies via pip install -r requirements.new.txt.
  • Prerequisites: Python 3.10, CUDA, vllm for efficient inference.
  • Usage: Inference is performed using src/unified_infer.py, with example commands provided for AlpacaEval and MT-Bench.
  • Resources: Inference requires GPU resources, with specific CUDA_VISIBLE_DEVICES and dtype (e.g., bfloat16) specified.
  • Links: Paper, Website, Demo.

Highlighted Details

  • Achieves comparable performance to fine-tuning methods on benchmarks like AlpacaEval and MT-Bench.
  • Offers multiple prompt versions (inst_1k_v4, inst_1k, inst_2k, etc.) with varying K-shot examples and token counts.
  • Includes evaluation scripts for AlpacaEval and MT-Bench, with a separate just-eval library for scoring.
  • Supports customization of data and models within src/unified_utils.py.

Maintenance & Community

The project is part of AI2 Mosaic's Re-Align project. The primary contributors are listed in the paper citation. Further community interaction details (e.g., Discord/Slack) are not explicitly mentioned in the README.

Licensing & Compatibility

The repository does not explicitly state a license. The paper is available on arXiv. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The README indicates that some evaluation content may be outdated and will be updated. The specific performance gains and limitations may vary depending on the base LLM used and the chosen URIAL prompt configuration.

Health Check
Last commit

1 year ago

Responsiveness

1+ week

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.