Archive of AI

Source Snapshot / 2023-04-19-stable-lm-open-llm-series-3

Stability-AI/StableLM

Linked event: 2023-04-19 · Stability AI Open-Sources Lightweight LLM Series Stable LM for Local On-Device Inference and Commercial Use

Publisher
GitHub
Archived
2026-11-23
Capture Method
Direct page capture
HTTP / SHA-256
200 / e315ae2b0c5a7066
Original URL
Open source ↗
Wayback Backup
Not archived
This page preserves a plain-text static snapshot against link rot. When citing figures, tables, or full legal terms, verify against the original URL and Wayback Machine archive.

[来源关键摘录] Stability AI 语言模型官方开源代码与文档仓库。

[正文前段节选] Skip to content

Navigation Menu

Appearance settings

You signed in with another tab or window. Reload to refresh your session.

You signed out in another tab or window. Reload to refresh your session.

You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

Repository navigation

NotificationsYou must be signed in to change notification settings

Fork996 (996)

Star15.6k (15.6k)You must be signed in to star a repository

StableLM: Stability AI Language Models

Apache-2.0 license

Custom properties

189 watching

Report repository

BranchesTags

Open more actions menu

Latest commit

Folders and files

Last commit message

Last commit date

View all files

Repository files navigation

“A Stochastic Parrot, flat design, vector art” — Stable Diffusion XL

This repository contains Stability AI's ongoing development of the StableLM series of language models and will be continuously updated with new checkpoints. The following provides an overview of all currently available models. More coming soon.

September 29, 2023

Released StableLM-3B-4E1T model under CC BY-SA-4.0.

August 5, 2023

Released patched StableLM-Alpha v2 models with 3B and 7B parameters.

April 28, 2023

Released StableVicuna-13B, our RLHF fine-tune of Vicuna-13B v0, which itself is a fine-tune of LLaMA-13B. Delta weights over the original Llama model is released under (CC BY-NC-SA-4.0).

April 20, 2023

Released initial set of StableLM-Alpha models, with 3B and 7B parameters. Base models are released under CC BY-SA-4.0.

Try to chat with our 7B model, StableLM-Tuned-Alpha-7B, on Hugging Face Spaces.

StableLM-3B-4E1T

Technical Report: StableLM-3B-4E1T

StableLM-3B-4E1T is a 3 billion (3B) parameter language model pre-trained under the multi-epoch regime to study the impact of repeated tokens on downstream performance. Given prior success in this area (Tay et al., 2023 and Taylor et al., 2022), we train on 1 trillion (1T) tokens for 4 epochs following the observations of Muennighoff et al. (2023) in "Scaling Data-Constrained Language Models" in which they find "training with up to 4 epochs of repeated data yields negligible changes to loss compared to having unique data." Further inspiration for the token count is taken from "Go smol or go home" (De Vries, 2023), which suggests a 2.96B model trained for 2.85 trillion tokens achieves a similar loss to a Chinchilla compute-optimal 9.87B language model ($k_n = 0.3$).

Training Tokens

2,795,443,200

Model Architecture

The model is a decoder-only transformer similar to the LLaMA (Touvron et al., 2023) architecture with the following modifications:

Sequence Length

Position Embeddings: Rotary Position Embeddings (Su et al., 2021) applied to the first 25% of head embedding dimensions for improved throughput following Black et al. (2022).

Normalization: LayerNorm (Ba et al., 2016) with learned bias terms as opposed to RMSNorm (Zhang & Sennrich, 2019).

Tokenizer: GPT-NeoX (Black et al., 2022).

Training Data

The dataset is comprised of a filtered mixture of open-source large-scale datasets available on the HuggingFace Hub: Falcon RefinedWeb extract (Penedo et al., 2023), and RedPajama-Data (Together Computer., 2023) and The Pile (Gao et al., 2020) both without Books3 and other subsets, and StarCoder (Li et al., 2023).

Given the large amount of web data, we recommend fine-tuning the base StableLM-3B-4E1T for your downstream tasks.

Training Details

Please refer to the provided YAML configuration file stablelm-3b-4e1t.yml for complete hyperparameter settings and the technical report for further details.

Downstream Results

The following zero-shot evaluations are performed with the lm-evaluation-harness using the lm-bench branch of Stability AI's fork. Full lm-eval JSONs can be found in the evals directory.

Pre-Trained Model

ARCChallenge

HellaSwag (✱)

LAMBADAOpenAI

meta-llama/Llama-2-13b-hf

huggyllama/llama-7b

meta-llama/Llama-2-7b-hf

Qwen/Qwen-7B

tiiuae/falcon-7b

mosaicml/mpt-7b

stabilityai/stablelm-3b-4e1t

baichuan-inc/Baichuan2-7B-Base

stabilityai/stablelm-base-alpha-7b-v2

openlm-research/open_llama_7b_v2

microsoft/phi-1_5

EleutherAI/gpt-neox-20B

togethercomputer/RedPajama-INCITE-7B-Base

cerebras/btlm-3b-8k-base (§)

EleutherAI/pythia-12b

openlm-research/open_llama_3b_v2

EleutherAI/gpt-j-6B

stabilityai/stablelm-base-alpha-3b-v2

facebook/opt-6.7b

EleutherAI/pythia-6.9b

EleutherAI/pythia-2.8b-deduped

§ Previous 3B Pre-Trained SOTA ? Outlier Reuslts* Byte-length Normalized Accuracy

StableLM-3B-4E1T achieves state-of-the-art performance (September 2023) at the 3B parameter scale for open-source models and is competitive with many of the popular contemporary 7B models, even outperforming our most recent 7B StableLM-Base-Alpha-v2.

StableLM-Alpha v2

StableLM-Alpha v2 models significantly improve on the initial Alpha models by incorporating architectural improvements such as SwiGLU (Shazeer, 2020) and using higher-quality data sources, as discussed below. The context length for these models is 4096 tokens.

StableLM-Base-Alpha-v2

2,796,431,360

6,890,209,280

Please refer to the provided YAML configuration files for hyperparameter details. E.g. for the extended StableLM-Alpha-3B-v2 model, see stablelm-base-alpha-3b-v2-4k-extension.yml.

Following similar work, we use a multi-stage approach to context length extension (Nijkamp et al., 2023), scheduling 1 trillion tokens at context length 2048 followed by 100 billion tokens at 4096. We found that sequence length warmup (Li et al., 2022) helped stabilize early spikes during the first ~80 billion tokens of pre-training. However, it was not applied to the final runs due to significant throughput penalties as length shapes grew across the curriculum.

The most impactful changes for StableLM-Alpha-v2 downstream performance were in the usage of higher quality data sources and mixtures; specifically, the use of RefinedWeb and C4 in place of The Pile v2 Common-Crawl scrape as well as sampling web text at a much higher rate (35% -> 71%).

The first pre-training stage relies on 1 trillion tokens sourced from a mix of the public Falcon RefinedWeb extract (Penedo et al., 2023), RedPajama-Data (Together Computer., 2023), The Pile (Gao et al., 2020), and internal datasets with web text sampled at a rate of 71%.

In the second stage, we include the StarCoder (Li et al., 2023) dataset and down sample web text to 55% while increasing sampling proportions of naturally long text examples in the aforementioned sources.

The following zero-shot evaluations are performed with the lm-evaluation-harness at commit df3da98c5405deafd519c2ddca52bb7c3fe36bef with the exception of SIQA which uses the add-siqa branch with prompt format

{doc['context']}\nQuestion: {doc['question']}\nAnswer:.

ARC Challenge✱

StableLM-Alpha-7B-v2

OpenLLaMA-7B-v2

RedPajama-INCITE-7B-Base

StableLM-Alpha-3B-v2

OpenLLaMA-3B-v2

Pythia-2.8B (deduped)

StableLM-Alpha-7B

StableLM-Alpha-3B

✱: Denotes byte-length normalized accuracy (acc_norm) as described in Gao, 2021.

▲: We score TruthfulQA using the normalized total probability assigned to the set of true answers (mc2).

StableLM-Alpha

StableLM-Alpha models are trained on a new dataset that builds on The Pile, which contains 1.5 trillion tokens, roughly 3x the size of The Pile. The context length for these models is 4096 tokens.

As a proof-of-concept, we also fine-tuned the model with Stanford Alpaca's procedure using a combination of five recent datasets for conversational agents: Stanford's Alpaca, Nomic-AI's gpt4all, RyokoAI's ShareGPT52K datasets, Databricks labs' Dolly, and Anthropic's HH. We will be releasing these models as StableLM-Tuned-Alpha.

StableLM-Base-Alpha

StableLM-Tuned-Alpha

3,638,525,952

7,869,358,080

Hugging Face

StableVicuna

[...内容已截断,完整版请查看原文或 Wayback 快照]