OpenICL  by Shark-NLP

Open-source framework for in-context learning research

Created 2 years ago
574 stars

Top 56.3% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

OpenICL is an open-source framework designed to streamline research, development, and prototyping of in-context learning (ICL) for large language models. It offers an easy-to-use interface with built-in state-of-the-art retrieval and inference methods, enabling systematic comparison of LMs and rapid prototyping.

How It Works

OpenICL facilitates ICL by abstracting the complexities of data preparation, prompt engineering, and model inference. Users define a DatasetReader to load and structure data, optionally use PromptTemplate to format prompts with in-context examples, and then initialize a Retriever (e.g., TopkRetriever) to select relevant examples. Finally, an Inferencer (e.g., PPLInferencer) uses the retriever and template to generate predictions, which can be evaluated using tools like AccEvaluator. This modular design allows for easy swapping of components to compare different ICL strategies.

Quick Start & Requirements

  • Install: pip install openicl
  • Prerequisites: Python 3.8+
  • Local Development: git clone https://github.com/Shark-NLP/OpenICL && cd OpenICL && pip install -e .
  • Documentation: OpenICL Documentation (currently updating)

Highlighted Details

  • Supports LLaMA models and self-consistency techniques (v0.1.8).
  • Integrates with Hugging Face Datasets for easy data loading.
  • Provides modular components for retrieval, prompting, and inference.
  • Includes an AccEvaluator for scoring predictions.

Maintenance & Community

The project was authored by Zhenyu Wu and others, with a paper published on arXiv. Community links are not explicitly provided in the README.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The documentation is noted as "updating," suggesting potential incompleteness or ongoing changes. The specific license and its implications for commercial use are not detailed.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Junyang Lin Junyang Lin(Core Maintainer at Alibaba Qwen), Shizhe Diao Shizhe Diao(Author of LMFlow; Research Scientist at NVIDIA), and
1 more.

LMaaS-Papers by txsun1997

0%
549
Curated list of LMaaS research papers
Created 3 years ago
Updated 1 year ago
Starred by Peter Norvig Peter Norvig(Author of "Artificial Intelligence: A Modern Approach"; Research Director at Google), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
2 more.

Hands-On-Large-Language-Models by HandsOnLLM

1.4%
16k
Code examples for "Hands-On Large Language Models" book
Created 1 year ago
Updated 1 month ago
Feedback? Help us improve.