7 comments

  • PetitPrince 48 minutes ago
    Have you reread what was produced by Claude Code before publishing ? This thing in one of the first paragraph jumps out:

    > you end up with about 44 terabytes — roughly what fits on a single hard drive

    No normal person would think that 44 TB is a usual hard drive size (I don't think it even exists ? 32TB seems the max in my retailer of choice). I don't think it's wrong per se to use LLM to produce cool visualization, but this lack of proof reading doesn't inspire confidence (especially since the 44TB is displayed proheminently with a different color).

    • QuantumNomad_ 28 minutes ago
      I agreed when I read your comment, but that turned out to be almost directly from the video https://youtu.be/7xTGNNLPyMI

      From around the 2:20 mark he says:

      “[…] actually ends up being only about 44 TB of disk space. You can get a USB stick for like a TB very easily, or I think this could fit on a single hard drive almost today”

      So it’s just slightly altered from what was said in the original video. And the LLM rewritten version of it also says “roughly” where he said “almost”, and I guess 44 TB is pretty roughly or pretty almost 32 TB. Although I’d still personally probably put it as “can fit on a pair of decently sized hard drives today” (for example across two 24 TB drives).

      Regardless, it’s close enough to what was said in the source video that it’s not something the LLM just made up out of nowhere.

  • gushogg-blake 1 hour ago
    I haven't found an explanation yet that answers a couple of seemingly basic questions about LLMs:

    What does the input side of the neutral network look like? Is it enough bits to represent N tokens where N is the context size? How does it handle inputs that are shorter than the context size?

    I think embedding is one of the more interesting concepts behind LLMs but most pages treat it as a side note. How does embedding treat tokens that can have vastly different meanings in different contexts - if the word "bank" were a single token, for example, how does embedding account for the fact that it can mean river bank or money bank? Do the elements of the vector point in both directions? And how exactly does embedding interact with the training and inference processes - does inference generate updated embeddings at any point or are they fixed at training time?

    (Training vs inference time is another thing explanations are usually frustrating vague on)

    • maciejzj 38 minutes ago
      AFAIK – the input is (at most basic level) a matrix with L tokens (rows) and d embedding length (cols). The input tokens are initially coded into discrete IDs but they are turned into embeddings by something like `torch.nn.Embedding`. The embedding layer can be thought of as a "lookup table" but it is matrix multiplication learned through gradient descent (adjusted at train time, fixed values at inference time). The length of embedding (d) is also fixed, L is not. If you check out the matrix multiplication formulas for both embedding layer and attention you will notice that they work for any number of rows/tokens/L (linear algebra and rules of matrix multiplication). The context limit is imposed by auxiliary factors – positional encoding and overall model ability to produce coherent output for very long input.

      When it comes down to the meaning of "bank" embedding, it cannot be interpreted directly, however, you can run statistical analysis on embeddings (like PCA). If we were to say, the embedding for "bank" contains all possible meaning of this word, the particular one is inferred not by the embedding layer, but via later attention operations that associate this particular token with the other tokens in the sequence (e.g. self attention).

    • GistNoesis 28 minutes ago
      Typically the input of a LLM is a sequence of tokens, aka a list of integer between 0 and max number of tokens.

      The sequence is of variable length. It was one of the "early" problem in sequence modelling : how to deal with input of varying length with neural networks. There is a lot of literature about it.

      This is the source of plenty of silent problems of various kind :

      - data out of distribution (short sequence vs long sequences may not have the same performance )

      - quadratic behavior due to data copy

      - normalization issues

      - memory fragmentation

      - bad alignment

      One way of dealing with it is by considering a variable length sequence as a fixed sized sequence but filling with zeros the empty elements and having some "masks" to specify which elements should be ignored during the operations.

      ----

      Concerning the embedding having multiple semantic meaning, it is best effort, all combinations of behavior can occur. The embedding layer is typically the first layer and it convert the integer from the token into a vector of embedding dimension of floating point numbers. It tries its best to separate the meaning to make the task of the subsequent layers of the neural network easier. It's shovelling the shit it can't handle down to road for the next layers to deal with it.

      For experiments you can try to merge two tokens into one or into <unknown> token, in order to free some token for special use without having to increase the size of the vocabulary.

      Embeddings some times can be the average of the disambiguated embeddings. Some times can be their own things.

      In addition to embeddings, you can often look at the inner representation at a specific depth of the neural network. There after a few layers the representation have usually been disambiguated based on the context.

      The last layer is also specially interesting because it is the one used to project back to the original token space. Sometimes we force the weights to be shared with the embedding layer. This projection layer usually can't use context so it must have within itself all necessary information to very simply map back to token space. This last representation is often used as a full sequence representation vector which can be used for subsequent more specialized training task.

      Embedding weights are fixed after training, but in-context learning occur during inference. The early tokens of the prompt will help disambiguate the new tokens more easily. For example <paragraph about money> bank vs <paragraph about landscape> bank vs bank will have the same input embedding for the bank token, but one or two layer down the line, the associated representation will be very different and close to the appropriate meaning.

  • PeakScripter 4 minutes ago
    currently working on somewhat same thing myself
  • lateral_cloud 30 minutes ago
    This is completely AI generated..don't bother reading.
  • Barbing 1 hour ago
    Lefthand labels (like Introduction) can overlap over main text content on the right in the central panel - may be able to trigger by reducing window width.
  • lukeholder 2 hours ago
    Page keeps annoyingly scroll-jumping a few pixels on iOS safari
    • tbreschi 1 hour ago
      Yeah that typing effect at the top (expanding the composer) seems to be the isssue
  • learningToFly33 3 hours ago
    I’ve had a look, and it’s very well explained! If you ever want to expand it, you could also add how embedded data is fed at the very final step for specific tasks, and how it can affect prediction results.