(More text coming soon.)
The tl;dr:
- Both Q4 and FP8 cache modes add very little loss compared to FP16
- Q4 is, perhaps suprisingly, more accurate than FP8
- Any loss of performance from Q4 on HumanEval is within the margin of error
- For summarizing long contexts there is no clearly discernible effect on the output
Token-level perplexity tests for various full-precision and quantized models using FP16, FP8 and Q4 cache modes. Dataset is The Pile, 10 rows of 512 tokens per test.
Results are updated for the new method which uses Hadamard rotations on the keys/values. Old results for version 0.0.18 and prior kept for reference.
Model | Precision | FP16 cache | FP8 cache | Q4 cache (old) | Q4 cache |
---|---|---|---|---|---|
Mistral 7B Instruct | 3.0 bpw | 13.33 | 13.43 | 13.41 | 13.37 |
-- | 3.5 bpw | 13.07 | 13.14 | 13.12 | 13.09 |
-- | 4.0 bpw | 12.90 | 12.90 | 12.90 | 12.90 |
-- | 5.0 bpw | 12.73 | 12.73 | 12.75 | 12.75 |
-- | 6.0 bpw | 12.73 | 12.75 | 12.74 | 12.74 |
-- | FP16 | 12.69 | 12.71 | 12.72 | 12.69 |
Mixtral 8x7B | 3.5 bpw | 10.27 | 10.41 | 10.39 | 10.32 |
-- | 4.0 bpw | 10.09 | 10.26 | 10.23 | 10.19 |
-- | 5.0 bpw | 10.02 | 10.16 | 10.15 | 10.04 |
Llama2 7B | 4.0 bpw | 11.43 | 11.92 | 11.74 | 11.60 |
-- | 5.0 bpw | 11.13 | 11.40 | 11.31 | 11.19 |
-- | FP16 | 10.91 | 11.24 | 11.16 | 11.05 |
The following are HumanEval tests on various full-precision and quantized models using FP16 and Q4 cache, respectively. Number of samples per task is limited to 10 (still giving 39360 completions in total produced over about 24 hours.)
The following tests were done prior to the improvements in 0.0.18-dev.
Model | Precision | FP16 cache | Q4 cache | diff |
---|---|---|---|---|
Mistral 7B Instruct | 3.0 bpw | 21.8% | 20.9% | -0.9% |
-- | 3.5 bpw | 23.1% | 23.3% | +0.2% |
-- | 4.0 bpw | 23.3% | 24.0% | +0.7% |
-- | 5.0 bpw | 25.1% | 27.3% | +2.2% |
-- | 6.0 bpw | 25.3% | 26.0% | +0.7% |
-- | FP16 | 25.1% | 26.0% | +0.9% |
Gemma 7B | 3.0 bpw | 11.9% | 11.9% | |
-- | 4.0 bpw | 29.7% | 29.8% | +0.1% |
-- | 5.0 bpw | 31.1% | 31.2% | +0.1% |
-- | 6.0 bpw | 31.7% | 32.0% | +0.3% |
-- | FP16 | 30.4% | 32.0% | +1.6% |
Mixtral 8x7B | 4.0 bpw | 33.5% | 31.3% | -2.2% |
Model | Precision | FP16 cache | Q4 cache | diff |
---|---|---|---|---|
Mistral 7B Instruct | 3.0 bpw | 43.3% | 47.0% | +3.7% |
-- | 3.5 bpw | 48.2% | 53.0% | +4.8% |
-- | 4.0 bpw | 45.7% | 48.2% | +2.5% |
-- | 5.0 bpw | 51.2% | 51.2% | |
-- | 6.0 bpw | 50.6% | 51.2% | +0.6% |
-- | FP16 | 49.4% | 53.0% | +3.6% |
Gemma 7B | 3.0 bpw | 28.7% | 29.9% | +1.2% |
-- | 4.0 bpw | 59.8% | 57.9% | -1.9% |
-- | 5.0 bpw | 64.0% | 62.8% | -1.2% |
-- | 6.0 bpw | 61.5% | 65.2% | +3.7% |
-- | FP16 | 64.0% | 60.9% | -3.1% |
Mixtral 8x7B | 4.0 bpw | 59.8% | 62.8% | +3.0% |
Here are summaries of a Guardian article
published in March 2024, totaling 8879 tokens. Summaries are produced by Miqu-70B at 4.25 bpw using default
settings in ExUI and the prompt ### Story summary:
FP16 cache, attempt 1
On 21 March 2021, Fleur Moody was knocked unconscious during a protest in Bristol against the police, crime, sentencing and courts bill. She was later charged with riot - a charge that required senior approval within the Crown Prosecution Service (CPS) and punishable with up to 10 years in prison. To date, 38 people have been charged with riot for their involvement in the Bristol protests, including Moody. Nineteen have been convicted, with sentences ranging from three to six years. Nine protesters are now in prison, and arrests are still being made. More people, and more women, have been imprisoned for rioting during one day in Bristol than in any other protest-related disorder since at least the 1980s. Evidence that has emerged during the protesters' trials suggests a different story: first, that many of the accused were, in fact, acting in self-defence against police aggression; and second, that the unprecedented deployment of riot charges may have had less to do with the severity of the violence during the protest than a politically driven crackdown on the right to protest.FP16 cache, attempt 2
In March 2021, a protest against the police, crime, sentencing and courts bill in Bristol turned violent, resulting in the arrest of 38 people who were charged with riot. Of those, 19 have been convicted with sentences ranging from three to six years, and nine are currently in prison. This is more people and more women who have been imprisoned for rioting during one day in Bristol than in any other protest-related disorder since at least the 1980s. However, evidence that has emerged during the protesters' trials suggests that many of them were acting in self-defense against police aggression, and that the unprecedented deployment of riot charges may have had less to do with the severity of the violence during the protest than a politically driven crackdown on the right to protest.FP16 cache, attempt 3
In March 2021, thousands of people gathered in Bristol to protest against the police, crime, sentencing and courts bill. The protest turned violent, with police and protesters clashing in the streets. In the aftermath, 38 people were charged with riot, a crime that carries a maximum sentence of 10 years in prison. To date, 19 people have been convicted, with sentences ranging from three to six years. The severity of the charges and sentences has raised questions about the right to protest and the role of the police in maintaining order.FP8 cache, attempt 1
In March 2021, 38 people were charged with riot after a protest in Bristol against the police, crime, sentencing and courts bill. The convictions have raised concerns about the right to protest in the UK. The defendants, including Fleur Moody, were charged with riot after a protest in Bristol against the police, crime, sentencing and courts bill. Moody was knocked unconscious by police during the protest. The convictions have raised concerns about the right to protest in the UK.FP8 cache, attempt 2
In March 2021, a protest against the police, crime, sentencing and courts bill in Bristol turned violent, resulting in 38 people being charged with riot. Since then, 19 have been convicted, with sentences ranging from three to six years. This is an unprecedented number of riot convictions for a single day of protest in the UK. The severity of the charges and sentences has raised questions about the police response to the protest and the role of political pressure in the prosecutions. Some defendants have claimed they were acting in self-defense against police aggression, and evidence has emerged that supports their claims. The case raises concerns about the right to protest and the balance between public order and civil liberties.FP8 cache, attempt 3
The story begins with Fleur Moody, a 26-year-old woman who joined a protest against the Police, Crime, Sentencing and Courts Bill in Bristol on 21 March 2021. During the protest, Moody was knocked unconscious by a police officer. She was later charged with riot and pleaded guilty to the lesser charge of affray, receiving a suspended sentence.The article then explores the context of the protest, which was in response to proposed laws that would give the police extensive new powers to clamp down on protests. The protest turned violent, with clashes between protesters and police resulting in injuries on both sides.
The article also highlights the unusually severe crackdown that followed the protest, with 38 people being charged with riot, a charge that carries a maximum sentence of 10 years in prison. Of those charged, 19 have been convicted, with sentences ranging from three to six years. Nine protesters are currently in prison.
The article raises questions about the excessive use of force by the police during the protest and the lack of accountability for police actions.
Q4 cache, attempt 1
On 21 March 2021, Fleur Moody, 26, joined a march protesting against proposed laws that would give the police extensive new powers to clamp down on protests. She was knocked unconscious by police officers during the protest and later charged with riot. To date, 38 people have been charged with riot for their involvement in the Bristol protests, including Moody. Nineteen have been convicted, with sentences ranging from three to six years. Nine protesters are now in prison, and arrests are still being made. The unprecedented deployment of riot charges may have had less to do with the severity of the violence during the protest than a politically driven crackdown on the right to protest.Q4 cache, attempt 2
Fleur Moody was one of 38 people charged with riot for their involvement in the Bristol protests against the police, crime, sentencing and courts bill in March 2021. Of the 19 who have been convicted, nine are in prison, and arrests are still being made. The severity of the state's response has been attributed to the violent extremists who allegedly hijacked the protest. However, evidence from the trials suggests that many of the accused were acting in self-defence against police aggression. The unprecedented deployment of riot charges may have had more to do with a politically driven crackdown on the right to protest than the severity of the violence during the protest.Q4 cache, attempt 3
In March 2021, Fleur Moody joined a protest in Bristol against proposed laws that would give the police extensive new powers to clamp down on protests. During the protest, Moody was struck on the head by a police officer and knocked unconscious. She was later charged with riot, despite having no memory of the incident. To date, 38 people have been charged with riot for their involvement in the Bristol protests, and 19 have been convicted, with sentences ranging from three to six years. This is the largest number of people to be imprisoned for rioting during one day in Bristol since at least the 1980s.Here are summaries of another article, published November 2023, totaling 11975 tokens: