Unofficial Hacker News companion — get notified on comment replies, and more.

FP64 Is All You Want, INT8 Is All You Need, FP4/6/8 Is All You Have (opens external site)

249 points by peter_d_sherman 3 days ago | arxiv.org | 61 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (21)

  1. It should be possible to replace a small tree of neurons with a smaller set of functions that back propagate more efficiently and are cheaper to calculate meanwhile using less ram/cpu per computation. It's not probable that our first shoot in the dark with neurons got the optimal math structure.

    Why would multiplication and addition be the only needed math, and not xor gates.

    Ai should be used to find that set of functions.

    Replies (10)
    1. I do think it'd be interesting to have some kind of localized snapping when subsets of neurons adjacent enough to segment from the network as a whole are close enough to a known family of functions over their inputs. Some kind of optimizing compiler over approximated neural circuitry
      Replies (1)
      1. The rub is that this is only worthwhile with a computational complexity gain. Maybe fitting low order polynomials might give that gain, but more complex functions take extra cycles to compute and would struggle to compete with chains of simple, practical activation functions.
        Replies (1)
        1. Yeah, it seems like the kind of thing that's interesting but ultimately impractical from an optimization standpoint, but it could be an interesting mechanistic interpretability result
    2. Neurons can do XOR gates.

      My first home assignment after being introduced to NN was to draw an XOR gate on paper using neurons.

      How to do it, is left as an exercise to the reader.

      Replies (1)
      1. They mean the inverse of that. Using XOR gates (or something similarly primitive) to implement neurons
    3. This sounds like Kolmogorov-Arnold networks.. rather than learning weights, learn a function computed by neurons
    4. Additions and multiplications give you gradients for back propagation, I’m not sure what the XOR equivalent would be.

      I believe binary networks use quantization-aware training for exactly that reason as well.

      Replies (2)
      1. On top of that, you can trivially construct an XOR gate with just 2 neurons in the hidden layer. Neural networks are already proven universal approximation schemes and they are differentiable, meaning you can train using gradient descent. These two facts are what gave rise to modern AI, not some half-motivated architecture or building block. Complexity is what you need, and gradient descent is what you use to tame it. There are probably still quite a few possible improvements to sections of the overall process, but the biggest revolution will probably come from making hardware more aligned with these ideas rather than making AI more aligned with traditional hardware.
      2. "XOR" is actually an incorrect name for addition modulo 2. For 3 or more inputs, true "XOR" and addition modulo 2 give different results ("exclusive or" means that 1 and only 1 of the operands is true, "addition modulo 2" means that an odd number of operands are true). No computer implements true "XOR", all implement addition modulo 2.

        Addition modulo 2 is special, because it is identical with subtraction modulo 2. This means that computer "XOR" has 2 possible interpretations, as addition modulo 2 and as subtraction modulo 2.

        Because addition modulo 2 is special, some of the algorithms that work with additions in bigger fields also work modulo 2, but other algorithms are no longer applicable.

    5. Because multiplication and addition let you model continuous-ish functions cheaply.
    6. Replies (2)
      1. This is really cool!
      2. These are cool, you should submit them if no one did before.
    7. It's not our first shot in the dark, and the current configurations are pretty well principled. I would expect that other designs could work well in a task-specific sense, but only marginally, and in terms of a generic structure, there are a lot of theoretical benefits of the current design.

      The entire ML literature for the last 30 years has been playing genetic optimisation on model designs and architectures. We are reaching the exploitation phase because it is becoming clear that exploration is giving diminishing returns.

      Replies (1)
      1. At the micro-scale, exploration is giving diminishing returns. We're just starting to figure out how to build really powerful ensembles though. If random forests and boosted trees were prototype steam engines, transformer based DNNs are locomotives, and there's still a whole universe of applications and improvements.
    8. There is already a Boolean version of differentiation, called Boolean variation, which includes a chain rule and allows for a binary version of backpropagation and gradient descent:

      https://proceedings.neurips.cc/paper_files/paper/2024/hash/7...

      It uses XNOR (IFF, the opposite of XOR) as the activation function. This allows for a binary neural network that is trained directly in binary, not quantized later.

      There is also a bunch of other papers that forego neural networks altogether and instead use something called "logic gate networks". Instead of neurons, they use logic gates. They don't have weights and use random connections instead. The learning consists in deciding which logic gate to use at each node ("neuron") in the network. They use conventional differentiation though, by "relaxing" the binary Boolean functions into continuous functions between 0 and 1, and then converting them to binary after training. I wonder whether the binary training approach from the paper above could be used for much faster training of these "logic gate networks". Currently they have extremely fast inference but slow training.

    9. Softmax is like a differentiable xor

      5/5 - I am now banned and can't reply

      Replies (1)
      1. That happens when you win HN. It’s an award that means you are a huge dork.