4,235 karma · joined Sep 10, 2015 (11y ago) · 1,525 submissions
comment 3y ago · link · parent
However, you also need to properly isolate software in containers or VMs since of course doing a system-wide undo on a system that is running a server will also revert the server state, which is usually disastrous.
comment 3y ago · link · parent
The problem seems to be more the 4KB of ROM, but only if one is trying to make it actually somewhat good, and also perhaps using 1979 tech for programming.
comment 3y ago · link · parent
Letting content be arbitrarily much brighter than what the user expects seems a terrible design, easily exploitable by advertisers and all sorts of attention thieves.
comment 3y ago · link · parent
comment 3y ago · link · parent
Subreddit moderators, like unfortunately usually moderators everywhere, can act arbitrarily and there is no way for users to remove or punish moderators.
So this means that /r/$FOO is not actually a subreddit about $FOO, moderated so that exactly any non-spam discussion about $FOO is allowed, but rather a dictatorship ran by whoever happened to grab the name first.
So for instance if a company creates a subreddit about their product before it's announced (which they are guaranteed to succeed at) or perhaps buys or acquires it afterwards, they are allowed to censor it arbitrarily to remove negative opinions or anything they don't like. Amateur moderators can instead moderate according to their personal agenda.
The advantage that something like Reddit can have other normal forums is the existence of an higher authority that users that are banned or censored can petition to to have them ban the moderator instead, and it was pretty absurd that there used to be no way to do that.
comment 3y ago · link · parent
Given that AArch64 has/had no 16-bit instruction support, it probably made sense to provide a generalization of a setcond instruction to make use of the encoding space of 32-bit instructions, and that's one of the most obvious (the other ones being cond ? imm : 0 or cond ? imm : reg).
comment 3y ago · link · parent
1. Use pointIdx instead of a string for fill keys. That's going to be way faster and memory efficient
2. There's no need to have separate added and visited. Just keep added and continue checking it before adding to the queue, and don't delete added entries
3. Even better, don't even use added but instead just check the output image data
4. Compute pointIdx incrementally by adding or subtracting 1 or width, only do a multiplication for the first point
5. Don't keep y coordinates in the loop, instead store the minimum and maximum pointIdx and then divide at the end to find the y coordinates (you still need to keep x to compute the x minimum and maximum if you need it, unless you can make the image have a power of two stride, in which case you can just mask pointIdx to compute x)
6. Use a black border instead of doing boundary checks
7. The % 5000 check is horribly slow since division is horribly slow. Use a power-of-two size and a bitwise and to be safe
8. Doing an update every 5000 pixels seems absurdly low. CPUs do billions of operations per second and a pixel should not take more than 100 CPU cycles with proper optimization, so even at around 100 fps you should be able to do in the magnitude of 100K pixels per frame, which means you shouldn't even need to do it incrementally or pre-process. If you really need incrementality you should use both a pixel number check and a timer and adaptively double or halve the pixel number if the timer check gives a too low or high time elapsed.
9. Using "chunks of pixel" is probably faster than single pixels and using horizontal groups of chunks even better, although that requires significantly more code
10. WebAssembly, with SIMD if available, is going to be faster than JavaScript
In general, this code has clearly not been written by someone experienced in writing optimized code, so I assume the pre-processing can also be greatly optimized (if it's even necessary after optimizing the filling code).
Also, there is no need to limit to 256 areas since you can use multiple images and all channels to store larger integers.
comment 3y ago · link · parent
E.g. the Linux kernel used (not sure if it's still like this) a buddy allocator to allocate pages and power-of-two blocks of pages and slab allocators to subdivide those pages and allocate data structures.
Another thing that the article doesn't mention that is important is that most production allocators make use of thread-local storage and either have per-thread caches of free blocks or sometimes whole per-thread memory regions. This is to reduce lock contention and provide memory that is more likely to be in the current core's cache.
comment 3y ago · link · parent
First, convert the input text to a sequence of token numbers (2048 tokens with 50257 possible token values in GPT-3) by using a dictionary and for each token, create a vector with 1 at the token index and 0 elsewhere, transform it with a learned "embedding" matrix (50257x12288 in GPT-3) and sum it with a vector of sine and cosine functions with several different periodicities.
Then, for each layer, and each attention head (96 layers and 96 heads per layer in GPT-3), transform the input vector by query, key and value matrices (12288x128 in GPT-3) to obtain a query, key and value vector for each token. Then for each token, compute the dot product of its query vector with the key vectors of all previous tokens, scale by 1/sqrt of the vector dimension and normalize the results so they sum to 1 by using softmax (i.e. applying e^x and dividing by the sum), giving the attention coefficients; then, compute the attention head output by summing the value vectors of previous tokens weighted by the attention coefficients. Now, for each token, glue the outputs for all attention heads in the layer (each with its own key/query/value learned matrices), add the input and normalize (normalizing means that the vector values are biased and scaled so they have mean 0 and variance 1).
Next, for the feedforward layer, apply a learned matrix, add a learned vector and apply a ReLU (which is f(x) = x for positive x and f(x) = kx with k near 0 for negative x), and do that again (12288x49152 and 49152x12288 matrices in GPT-3, these actually account for around 70% of the parameters in GPT-3), then add the input before the feedforward layer and normalize.
Repeat the process for each layer, each with their own matrices, passing the output of the previous layer as input. Finally, apply the inverse of the initial embedding matrix and use softmax to get probabilities for the next token for each position. For training, train the network so that they are close to the actual next token in the text. For inference, output a next token according to the top K tokens in the probability distribution over a cutoff and repeat the whole thing to generate tokens until an end of text token is generated.
comment 3y ago · link · parent
It also makes it easier for some tools to only use the lexer, which makes them more likely to work even if code is not syntactically correct or written for a newer language revision than the tool.
comment 3y ago · link · parent
comment 3y ago · link · parent
Seems easily countered by using the same toxicity prediction software when evaluating synthesis requests (but I'm not sure whether this actually matters, or whether skilled chemists can easily synthesize anything themselves anyway).
comment 3y ago · link · parent
Or you could generate a per-user subkey with a quota if the upstream service supports that.
comment 3y ago · link · parent
In this case, the state is the number of walls passed, so just create a graph made of (v, k) pairs where for adjacent v and w in the grid, (v, k) connects to (w, k) if there is no wall, and it connects to (w, k + 1) if there is a wall.
Then run A*, finding the shortest path from (start, 0) to (end, 1), reconstruct the path and look at where it transitions from a (v, 0) to a (w, 1) and then return the wall between v and w.
You can use this for all sorts of other constraints, like finding a path that only changes direction up to N times, or a path where you don't get eaten by the monster moving deterministically (in this case the state is the monster position), or a path where you spend up to N time underwater consecutively, etc.
But GPT-4 seems very bad at solving problems, so even though this is an easy problem, it's not unexpected that it would not come up with this solution.
comment 3y ago · link · parent
For example, by adding the imaginary numbers, there is no longer an ordering compatible with addition and multiplication (ordering compatible with multiplication means that z > 0 and x > y implies x * z > y * z: assuming that, if 0 < i, then 0 = 0 * i < i * i = -1, absurd, or if 0 > i and thus 0 < -i, then 0 = 0 * -i < -i * -i = -1, absurd).
You can certainly add a number x such that x = x + 1 (e.g. what is commonly called an infinity or NaN), but that implies no longer having additive left inverses assuming you keep associativity of addition and 0 != 1 (since otherwise 0 = -x + x = -x + (x + 1) = (-x + x) + 1 = 0 + 1 = 1).
comment 3y ago · link · parent
Rather, OpenAI has decided to respond to an injuction to stop processing Italian PII within 20 days by immediately configuring their Cloudflare account to block connections from IPs where the GeoIP lookup resolves to Italy, which is easily circumvented by a VPN or proxy.
comment 3y ago · link · parent
It seems like it would make more sense to have a single token for all variants and then a "capitalized where not expected" token (e.g. "foo Foo"), a "not capitalized where expected" token (e.g. "foo. foo") and a "missing space where expected" token (e.g. "foo.Foo").
The lack of any normalization also means that WrItInG tExT lIkE tHiS will make future GPT versions not be able to make full use of the text during future training unless they change the tokenization (or the model is so overpowered that it doesn't matter).
comment 3y ago · link · parent
Just try submitting the IOI 2022 and IMO 2022 problems.
Obviously it still outperforms the average human, since the average human has no knowledge of mathematics or computer science whatsoever.
comment 3y ago · link · parent
In general it doesn't make sense to compress images this way, since the algorithm is not invariant with respect to 2D image rotation, a very relevant operation for realistic images, but is invariant with respect to row/column permutations, which are not a relevant operation for realistic images.
comment 3y ago · link · parent
It's not clear how Intel thought it could possibly work.
comment 3y ago · link · parent
Also, since Tor browsing is often done with JavaScript off, and removing JavaScript removes a huge amount of web features that need to be supported (including a JavaScript engine, which I think Servo still doesn't have a pure Rust implementation of), it's much easier to make a usable browser for this use case than others.