9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions
comment 3y ago · link · parent
Transformer is a building block (a part) of a language model. "Language model" is an algorithm that can predict words following given words. For example, you can give a text to a model and get a summary of this text, or an answer to the question in the text, or a translation of the text.
Language models are often made of two parts - encoder and decoder. The encoder reads input text (each word is encoded as a bunch of numbers, for example, as list of 512 floating-point numbers) and produces a "state" (also a large list of numbers) which is expected to encode the meaning of the text. Then the decoder reads the state and produces the output as words (to be exact, as probabilities for every possible word in the dictionary to be at a certain position in the output).
Before Transformers, people tended to use so called "recurrent neural networks" architecture. With this approach, the encoder processes the text word by word and updates the state after every word:
state = some initial state
for word in text:
state = model(state, word)
model(...) here is a complicated mathematical function, often with millions of operations and parameters.As I have written above, after reading the text, the state should encode the meaning of the text.
But it turned out that this approach doesn't scale well with long or complicated texts because the information from beginning of the text gets lost. The model tends to "forget" what it had read before. So a new architecture, "Transformers", was proposed. The difference is that now we give entire text (each word encoded as bunch of numbers) to the model:
state = model(input text)
Now the model processes the text at once. But implementing this naively would result in a very large model with too many parameters that would require too much memory and computing time. So developers used a trick here - most of the time each input word is processed separately from others (as in recurrent model), but there are stages, called "attention" where the words are processed together (and those stages are relatively light), so it looks like this: # stage where all text is processed at once
# using quick algorithm
state1 = attention(input text)
# stage where each part of state is processed independently
# with lot of heavy calculations
state2 = map(some function, state1)
state3 = attention(state2)
state4 = map(some function, state3)
...
To summarize, in Transformers the model processes the text at once, but we have to employ tricks and split processing into stages to make calculation feasible. Probably that is why some people believe the authors should receive a reward for their work.I think this explanation is as far as one can get without learning ML.
comment 3y ago · link · parent
comment 3y ago · link · parent
Also, x86 code is compact, but not as compact as in era of 8080 [2] - here addition and multiplication require 3 bytes each, 6 bytes total. To my surprise, ARM has an add-multiply instruction and it uses just 4 bytes (instead of 8) [3].
And RISC-V uses 6 bytes because of shortened instruction for addition [4]
Of course, this simple function cannot be a replacement for proper analysis, but it seems that x86 code is not significantly denser.
Also to my great disappoitment none of those CPUs has checked overflow for arithmetic operation.
[1] https://godbolt.org/z/jsoccE5jv
[2] https://godbolt.org/z/jTMs1MEzh
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
ex.head == :. && return union!(sym,[ex])
start = ex.head==:(call) ? 2 : 1
Also I don't like |> combination because it is hard to type. Why not use just single pipe character.comment 3y ago · link · parent
To be truly vendor-agnostic it needs to support OpenGL or Vulkan.
Also this is the first time I saw examples of Julia code and the syntax looks worse than C++.
comment 3y ago · link · parent
Better than having keys which I cannot control on my computer. And I don't play games anyway.
comment 3y ago · link · parent
Why does WiFi card need to be "compatible" with CPU? Isn't it enough to be compatible with PCI-Express? Or are there backdoors that do not work with Intel-backdoor-compatible WiFi cards?
comment 3y ago · link · parent
Many of those features are not so useful and their main use is fingerprinting, for example:
- WebGL is mostly used for fingerprinting
- enumerating installed fonts is mostly used for fingerprinting
They should be put behind a permission popup, so that only those sites that really need them (e.g. graphic editors, text editors) can use them. So nothing gets broken.