HN user

lappa

663 karma

I work on inference and training of transformers models.

You can reach me at andrew@hn.rew.la

Posts5
Comments166
View on HN

This isn't suggesting no one understands how these models are architected, nor is anyone saying that SDPA / matrix multiplication isn't understood by those who create these systems.

What's being said is that the result of training and the way in which information is processed in latent space is opaque.

There are strategies to dissect a models inner workings, but this is an active field of research and incomplete.

Provided a constant temperature of 1.0, you can train the model on prompts with probablistic requests, with loss determined by KL divergence.

Expectation: 80% left, 20% right

Model sampling probability: 99% left, 1% right

>> 0.80 * math.log(0.99 / 0.80) + 0.20 * math.log(0.01 / 0.20)

-0.42867188234223175

Model sampling probability: 90% left, 10% right

>> 0.80 * math.log(0.9 / 0.80) + 0.20 * math.log(0.1 / 0.20)

-0.04440300758688229

Of course, if you change the temperature this will break any probablistic expectations from training in this manner.

Look at it from an algorithmic perspective. In computer science many algorithms take a non-constant number of steps to execute. However, in transformers models, there are a limited number of decoder blocks, and a limited number of FFN layers in each block. This presents a theoretical upper bound on the complexity of the algorithms a decoder network can solve in a single token generation pass.

This explains why GPT4 cannot accurately perform large number multiplication and decimal exponentiation. [0]

This example can extend to general natural language generation. While some answers can be immediately retrieved or generated by a "cache" / algorithm which exists in latent space, some tokens have better quality when their latent-space algorithm is executed in multiple steps.

[0] https://www.semanticscholar.org/reader/817e52b815560f95171d8...

Very interested in the expansion of RL for transformers, but I can't quite tell what this project is.

Could you please add links to the documentation to the readme where it states "It includes detailed documentation".

Also maybe DPO should use the DDPG acronym instead so your repos Deterministic Policy Optimization isn't confused for trl's Direct Preference Optimization.

A few days ago I saw a post using NeuralFlow to help explain the repetition problem.

https://old.reddit.com/r/LocalLLaMA/comments/1ap8mxh/what_ca...

I’ve done some investigation into this. In a well trained model, if you plot the intermediate output for the last token in the sequence, you see the values update gradually layer to layer. In a model that produces repeating sequences I almost always see a sudden discontinuity at some specific layer. The residual connections are basically flooding the next layer with a distribution of values outside anything else in the dataset.

The discontinuity is pretty classic overfitting. You’ve both trained a specific token to attend primarily to itself and also incentivized that token to be sampled more often. The result is that if that token is ever included at the end of the context the model is incentivized to repeat it again.

...

Literally just plotting the output of the layer normalized between zero and one. For one token in mistral 7B it’s a 4096 dimension tensor. Because of the residual connections if you plot that graph for every layer you get a really nice visualization.

Edit: Here's my visualization. It’s a simple idea but I've never personally seen it done before. AFAIK this is a somewhat novel way to look at transformer layer output.

Initial output: https://imgur.com/sMwEFEw

Over-fit output: https://imgur.com/a0obyUj

Second edit: Code to generate the visualization: https://github.com/valine/NeuralFlow

This is nearly identical to the overfitting example in the repo, only really representing a binary, but it's a good start. Perhaps some transformations can be applied to help further?

Not a material science expert, however per their paper, they use DFT to verify the stability, then use the verification status to improve the model.

candidate structures filtered using GNoME are evaluated using DFT calculations with standardized settings from the Materials Project. Resulting energies of relaxed structures not only verify the stability of crystal structures but are also incorporated into the iterative active-learning workflow as further training data and structures for candidate generation

Excellent, appears Amazon has introduced two important things here:

- Rope theta of 100,000, likely from the Llama 2 Long paper which found that a large theta helped regulate attention between distant tokens[0]

- A 16k (effective 32k) context window, improving upon Mistrals 4k (effective 8k) context window

In The Llama 2 Long paper, they saw improvement in short context benchmarks as a result of long context fine tuning. I can't find any of the expected MMLU / HellaSwag / etc benchmarks yet. Benchmarks haven't been submitted to MTEB yet.

Some user anecdotally seem to be having trouble with generating quality responses [2][3][4]. I can't find any examples of users getting good results from the model outside of using exact examples from the documentation.

[0] https://arxiv.org/pdf/2309.16039.pdf

[2] https://old.reddit.com/r/LocalLLaMA/comments/17jd00g/mistral...

[3] https://old.reddit.com/r/LocalLLaMA/comments/17kzlbl/anyone_...

[4] https://old.reddit.com/r/LocalLLaMA/comments/17b0n8t/llama_2...

Great work, lots of useful information here.

The only thing I wish you did different was explored alpha > 2 * r.

In this blog post, the author found that alpha of 4 * r (where r=64) outperformed all smaller alphas in terms of loss when finetuning Llama-7b on databricks-dolly-15k.

https://medium.com/@drishtisharma96505/comparative-analysis-...

Additionally you identify (alpha = 2*r) r=16 as inferior to r=256, however aside from arithmetic, r=16 actually outperforms all others. And the base model outperforms any finetuning for both arithmetic metrics.

"For example, HyperAttention makes the inference time of ChatGLM2 50% faster on 32k context length while perplexity increases from 5.6 to 6.3."

"when half of all attention layers are patched (i.e., 14 layers), we verify that most of the tasks do not degrade more than 13%."

According to the paper, for most tasks it reduces benchmark scores substantially. Perhaps to the point where a smaller model would yield better inference time and higher benchmarks.

However, summarization benchmarks see almost no degredation, great!

This seems half-baked and there are numerous faulty assumptions in this article. For example, Bitcoin miners cannot computer gradients. Their ASICs can only calculate double-sha256.

Additionally, the premise of sending gradients of models trained on private data while retaining privacy seems problematic. While you likely can't reverse it to calculate the batch's contents, it is leaky.

Further, gradient calculations are not a good proof of work. A good proof of work is difficult to calculate and easy to verify (i.e. an extremely low hash value).

The core premise, using blockchains to store terabytes of models and datasets, doesn't make any sense whatsoever.

The problems highlighted in this article however are valid, and it would be great to see something like IPFS for datasets and models.

Interesting how this method quantizes different layers / modules in a manner that minimizes perplexity as it adjusts parameters.

I'd be interested to see how 2.5 bit quantization compares to an unadjusted 4-bit baseline. Additionally would be interesting to see the usual benchmarks (ARC, HellaSwag, MMLU, TruthfulQA) of this method at different average bitrates (2.0, 2.5, 3.0, 4.0, ...). Would also be interesting to see if an average bitrate of 4 is just as fast and small as a constant bitrate of 4, but more accurate.

Very exciting work, looking forward to trying this out on my models!

This is great! If I could suggest changes that would make this especially useful for me and likely others it would be

1) The ability to substitute in your own LLM, specifically I'd like to be able to use Code Llama which was released a few days ago.

2) The ability to automatically determine an appropriate plot type based on natural langugae metadata. This would allow me to bulk process labelled timeseries data. For example if I set the X label as date, it should know to make a line chart. If I present data labelled with a description involving as "percent of" or something the LLM should know to use a pie or bar chart. If I give a description involving quarterly revenue, it should know it's a time series, but with discrete values, so a bar chart with negative and positive values, etc.

Llama 2 3 years ago

Here are some benchmarks, excellent to see that an open model is approaching (and in some areas surpassing) GPT-3.5!

AI2 Reasoning Challenge (25-shot) - a set of grade-school science questions.

- Llama 1 (llama-65b): 57.6

- LLama 2 (llama-2-70b-chat-hf): 64.6

- GPT-3.5: 85.2

- GPT-4: 96.3

HellaSwag (10-shot) - a test of commonsense inference, which is easy for humans (~95%) but challenging for SOTA models.

- Llama 1: 84.3

- LLama 2: 85.9

- GPT-3.5: 85.3

- GPT-4: 95.3

MMLU (5-shot) - a test to measure a text model’s multitask accuracy. The test covers 57 tasks including elementary mathematics, US history, computer science, law, and more.

- Llama 1: 63.4

- LLama 2: 63.9

- GPT-3.5: 70.0

- GPT-4: 86.4

TruthfulQA (0-shot) - a test to measure a model’s propensity to reproduce falsehoods commonly found online. Note: TruthfulQA in the Harness is actually a minima a 6-shots task, as it is prepended by 6 examples systematically, even when launched using 0 for the number of few-shot examples.

- Llama 1: 43.0

- LLama 2: 52.8

- GPT-3.5: 47.0

- GPT-4: 59.0

[0] https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderb... [1] https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderb...

This is a really interesting project with a lot of potential.

If I were a sponsor looking for a podcast I would want my search process to look something like this:

- Search for a term relevant to my line of business

- See a list of podcasts ordered by % of utterances which contain my key phrase throughout their last N episodes

- Annotation of how many listeners each podcast had in last N episodes

The Uber Bubble 4 years ago

And in small cities/towns, getting a taxi was nearly impossible a lot of the times.

My experience has been the opposite. In small towns you cannot get use rideshare apps, but you can dial a taxi service. This has been the case in every town of less than 1,000 I've needed a ride in.

Interesting but I feel like I'm still missing an important piece of information to use this tool. Is there a resource which provides optimal nutrient ratios for different plants?

Thanks for posting this.

This is a work in progress and definitely isn't at the point where, for example, a Ubuntu user with little technical background could switch over easily.

As many commenters have pointed out, users will still be questioning which options they should change to accomplish a goal and will need to use a search engine.

To alleviate these problems, our next major step is "Guided Configuration"[0]. This will allow users to select a task (e.g. add a user, add a group, configure your desktop environment, configure sound, configure bluetooth, etc) and be provided a list of options relevant to the task.

Additionally "Recommended Options"[1] will inform users of options relevant to their current configuration which they have yet to define.

There are a few other smaller changes in the works to help with usability, and I'm open to suggestions for how we might continue to improve UX and make configuring NixOS intuitive.

Also, if you've used Nix-Gui, please consider filling out the UX Survey: https://github.com/nix-gui/nix-gui/issues/129

[0] https://github.com/nix-gui/nix-gui/issues/77 [1] https://github.com/nix-gui/nix-gui/issues/21