OpenAI releases solutions to many open problems in mathematics. They provide both lean proofs and preprints in a git repo. We knew they were working on this, now it has been released.
Some results that I thought were interesting include (numbers from this document):
#4: Hilbert's 10th problem was resolved negatively 1970. It asks if there is an algorithm to determine whether a multi-variable polynomial with integer coefficients has an integer root. This is a generalization of that result to rational roots: It shows that no algorithm that can decide whether a polynomial with integer coefficients has a rational root.
#5: Catalan's constant
#17: The irrationality exponent of
#25: Every rational
#28: The Gaussian moat conjecture is true. Here is what it says: Pretend the Gaussian primes are islands and the rest of
#102: The Unique Games Conjecture is true.
#103: L = RL = BPL, i.e. probabilistic algorithms with logarithmic space complexity can be de-randomized to deterministic algorithms with logarithmic space complexity.
#107: Matrix multiplication in
#109: Integer multiplication (slightly) faster than
#130: Fourier transforms (slightly) faster than
#137: One-tape Turing machines that run in time
#155: There is a tile that forces aperiodic tiling of
#158: The chromatic number of (the unit distance graph of) the plane is greater than 5.
#241: "Rigidity of Turing Degrees": No non-trivial relabelling of Turing degrees preserves their order.
#261: Characterize spectrum of lattice Anderson model in dimension 2 vs 3 or more dimensions.
#363: Demonstrate two solutions of the Boltzmann equation for hard spheres, with the same initial conditions.
And the Quasi-Riemann Hypothesis!
The most surprising thing to me was the claim of an average of 3 hours of thinking time per solved problem. To me it seems that the model has passed human level abilities which allow it to scoop up these results with relatively little effort. If a model can be trained on open problems and presumably create it's own open problems from the result of solving open problems I'm not sure where it will end.
Solving problems they're good at, but creating its own open problems remains to be seen. Some, like Noam Brown, think AI not being able to come up with good problems to train on is a plausible (not likely, but plausible) way for things to plateau.
Woah. Some additional context for #107, matrix multiplication time complexity:
From 1990 to August 2026, the best known exponent improved only from about 2.3755 to 2.3711. Then this new result just jumps straight to 2.25. This is a famous problem that a huge number of researchers have worked on.
And #109, integer multiplication, is just as bizarre. Most of the experts in the field had believed for a long time, maybe 50 years, that O(n log n) was the asymptotic barrier, and it would be a very natural one at that, and what’s left is just figuring out how to get there. And then it turns out it wasn’t even optimal?
Yup. Human mathematicians reached
Here are Scott Aaronson's thoughts on the resolution of Unique Games, and some of the other theoretical CS problems: https://scottaaronson.blog/?p=10169
Update on #109: this post complains that the AI's algorithm "cheats" by using unbounded coefficients, making counting exact arithmetic operations unfaithful to other models of computation (because multiplying by really big numbers makes each arithmetic op pretty expensive, as you might guess). The main interesting thing from the post is that it links this paper, which is short but very nice: Morgenstern, 1973, which actually establishes an
If you're working with multidimensional tensors (eg. in numpy or pytorch), a helpful pattern is often to use pattern matching to get the sizes of various dimensions. Like this: batch, chan, w, h = x.shape. And sometimes you already know some of these dimensions, and want to assert that they have the correct values. Here is a convenient way to do that. Define the following class and single instance of it:
class _MustBe:
""" class for asserting that a dimension must have a certain value.
the class itself is private, one should import a particular object,
"must_be" in order to use the functionality. example code:
`batch, chan, must_be[32], must_be[32] = image.shape` """
def __setitem__(self, key, value):
assert key == value, "must_be[%d] does not match dimension %d" % (key, value)
must_be = _MustBe()
This hack overrides index assignment and replaces it with an assertion. To use, import must_be from the file where you defined it. Now you can do stuff like this:
batch, must_be[3] = v.shape
must_be[batch], l, n = A.shape
must_be[batch], must_be[n], m = B.shape
...
Linkpost for: https://pbement.com/posts/must_be.html
Epistemic status: "Well, it should work."
The thing about self-distillation is that not only can you train a student to match a teacher which has context lacked by the student, you can likewise give the student context lacked by the teacher. This seems potentially very helpful for alignment properties. For example, one could give the student a prompt that tempts the model to provide a sycophantic (but wrong) answer. Or one could give it a prompt that tempts the model to reward hack. Training to match a teacher that lacks these prompts then encourages the model to avoid these behaviours, and act as an an untempted version of itself would.
I searched around a bit for papers and found this one: https://arxiv.org/pdf/2608.09555 It doesn't really discuss the alignment applications though.
Very interesting! Worth an experiment, but my guess is you won't learn nuanced things. To imitate a teacher who has more context, an student must learn to do a hard computation: solve a problem in NP without the certificate (without the hint)[1]. To imitate a teacher who has less context, the student has to learn an easy computation: become blind to the gym's added contexts, the way I've learned to become blind to inserted ads.
Nerdy way to say this: the complexity class NP (student's hard problem) is the "shadow" of P (teacher's easy problem). Every language in NP is a language in P "projected down" (with characters removed); there's an easy language in P that looks like <certificate|problem>, and a language in NP is those strings with the certificate (hint) removed.
The previous strongest argument for "why make a humanoid robot?" was that the world is already designed for humans to navigate and manipulate. But there are many robot designs that could navigate the world equally well, especially if we only care about a subset of tasks and environments. The new strongest argument is that if the robot is humanoid then you can pre-train its policy on human actions.
or that it is easier for a human control a humanoid robot I guess.
Humanoid robots controlled by surgeons did world-first operation on live pigs
For navigation, I'd assume that wheels are easier, even for humans to control, because you don't need to worry about balancing the robot, and humans are certainly good enough at using a joystick. Plausibly humanoid hands could be more intuitive though.
Before continuing, I should say that overall I think humanoid robots is not a good idea.
Wheels work for flat ground but not for staircases. Afaict wheel on leg hybrids handle staircases well but at that point it looks like it is more complex than having 2+ legs. You can also have wheel extensions for humanoid robots, im pretty sure ive seen it in Unitree's videos.
Controlling any sort of robot to do basic navigation, is something that I imagine will be close to fully automated that it doesn't matter in the discussion of humanoid vs other robot. Though, do you know humanoid robots handle the balancing themselves, and that people do use controllers to control without needing to wrry about balance?
The fact that humanoid robots can handle a larger set of tasks and environments is also its appeal exactly because mass production can reduce cost significantly.
I really sound like a humanoid robot proponent but I just don't think these are that good of arguments against it. I can write a longer list of issues I have with humanoid robots when the time comes.
Link to interesting post on why Helion energy is not going to work: https://www.bhauth.com/blog/flawed ideas/helion.html
Scenario: I would like to sell an API. But it should return an error for a certain class of requests that for ethical, business, or other reasons, I do not want to fulfill. Using machine learning, I have created a model to automatically classify requests. However, this model is vulnerable to adversarial examples. Given enough tries, an adversary can find examples that trick my classifier into allowing their request through. I need to prevent this from happening. Here are some methods to accomplish this:
Okay, fine. Can we at least make it annoying and inconvenient for adversaries to do find adversarial examples? Here are some methods to accomplish this:
Yes, this is about Anthropic's silent nerfing of Fable for certain tasks. The second option here seems much better to me for that case, and I'm curious why they chose to go with the first. Is there any motivation they could have beyond trying to prevent gaming of their classifier?
You can disable the silent nerfing when using the api, so it's not really about preventing fooling the classifier.
Okay, that does change things, thanks!
Any idea what they could be aiming for then? Letting you disable it in the API but also having it otherwise be a silent effect that gives no notification that it has happened is a really weird combination.
ig they think it makes for a better user experience.
Hmm, guess so, yeah. Of course, they're wrong and should have run the idea by Claude first. But I can't think of a different reason either.
It seems like there should be pretty decent solutions with combinations of methods. If many of the first requests from a new account get flagged it's banned, etc.
If you're retaining the requests and investigating ones that seem criminal in collaboration with law enforcement, that's a strong incentive to not try them.
I thought this recent substack post was very insightful: https://eliasschmied.substack.com/p/social-agency
tldr is that the post asks how much of our ability to plan comes from our brains being designed to plan, and how much is purely learned (by social imitation of other people's planning, or explicit instruction from others on how to plan). It answers that a surprising amount is purely learned. (This summary does not do the post justice and you should really go and read it.)
Below is a copy of a comment I left:
Thank you for writing this!
I have been developing similar kinds of suspicions for a little while (that even though we know how to program algorithms like MCTS, that doesn't mean human brains have a built-in analogue, and that many things like this are learned, not implemented on an architecture level), but I was missing a lot of the pieces you have here, and reading this really crystallized it for me.
A priori, we would expect the first, naturally arising, agent to attain this agency in the stupidest, most hacky way possible.
Re this, as you note later, LLM planning capabilities also arise from learning some kind of prior over chains of thought, and then applying a bit of "cherry on top" RL. So it also seems that the first general [1] artificially arising agent also attained agency in the stupidest, most hacky way possible, exactly as humans did. We are, in this respect at least, following in the footsteps of evolution on our quest to build AI.
I'm not sure the extent to which this affects the AI ruin hypothesis, and how powerful we can expect intelligence to become. I share your opinion that it must change the story somehow, but at the same time, strong planning abilities can be dangerous, regardless of whether they're learned or architectural. It's unclear whether the ultimate, optimally-designed successor agent would have built-in planning, or would have to learn to plan, but I find myself expecting it to be extraordinarily powerful either way.
You mostly describe the social aspect of learning to plan here, but I do think that it's a mix of both social imitation and RL. Eg someone learning to play chess would socially absorb the idea of looking ahead several moves, and various heuristics for evaluating board positions, but they'd also just improve from playing several games and seeing what planning techniques are actually effective. [2]
Nothing left to elevate the hypothesis of a simple core structure of general planning or agency to our attention.
Re this, I think it is slightly overstated. All the old structure of VNM rationality still exists, it's just intractable to compute in the real world, just like we already knew it was. I think what changes here is our estimate of how well an algorithm of a given cost can approximate it. In particular, it starts looking harder to approximate very well, and we might start hoping instead that we can get good real-world results from things that are actually quite far from VNM rational.
Questions:
- World modelling does seem pretty architectural to me right now. There is a move that is often used in planning where we "deform" our world model to correspond to some hypothetical scenario, and get it to spit out predictions for what values various variables are likely to take. I tend to think that this kind of "deformation" into fake scenarios is also a built-in ability, do you agree? Or an alternate hypothesis could be that we have a built-in direct sensory world model, and also a learned far-mode world model, and only the latter is deformable?
- This all makes me think that the kinds of modifications to LLMs needed to trigger the singularity or whatever, are not actually that big? Like, if planning is learned anyways, we don't need to drastically modify the transformer architecture to wedge some kind of planning into it, RL on chain of though is already all we need. Given that "big dumb blob of intelligence" is going to be the paradigm that wins, are our options for getting friendliness basically just "use good training data" and "make the big blob more sample-efficient"? Does increasing sample-efficiency even help?
- This is a great article. I hope you are planning to crosspost to lesswrong?
Fairly general, at least. I specified this because in many specialized domains agents do use a built-in search process. Eg. alpha go using MCTS. ↩︎
Maybe RL in the weak sense. Humans don't really seem to be able to directly reward ourselves purely mentally in the same way as we'd get a direct reward for eating a cookie while hungry. So arguably the kind of tuning that happens here could be better classified as epistemic, though it does affect the distribution of planning actions like a true reward-update would. ↩︎
Rhymes with Is Clickbait Destroying Our General Intelligence? I suspect that writing a good answer to a silly question on r/whowouldwin, arguing with a friend about what Light Yagami's next move should be, and the art of best response are all pointing in a similar direction. Likewise, I suspect some amount of personality and internal 'self-hood' is built socially.
The post is now here on LW too: https://www.lesswrong.com/posts/xopGsfQxiLcjXEkbE/social-agency
I've been trying to use Sol to resolve an open mathematics conjecture; since now even the publicly available models are very good at this kind of thing. (See, eg the recent disproof of the Jacobian conjecture, though I began my efforts before that.)
Unfortunately, it seems that I have screwed up and picked a conjecture that happens to actually be true.
Update on this: Unsurprisingly given recent events, Astra is able to easily resolve the problem. The conjecture (now theorem) is indeed true. However, one shouldn't draw many conclusions about the AI's power from this, as there was a (I think near-entirely human-written) paper published on the arxiv recently containing a theorem that implied a special case of the conjecture. Astra found and read it before coming up with its answer, and used essentially the same techniques in its solution, as far as I can tell. I suppose I could try again with a fresh instance and ask it not to access the internet, if anybody is really curious.
I'm still trying to work through the proof, (it seems to be a pretty simple one as far as proofs go, but contains ideas I'm unfamiliar with).
People here might find this post interesting: https://yellow-apartment-148.notion.site/AI-Search-The-Bitter-er-Lesson-44c11acd27294f4495c3de778cd09c8d
The author argues that search algorithms will play a much larger role in AI in the future than they do today.
Background: this tumblr post
I’m tired and annoyed, since wasn’t the upcoming singularity supposed to Change Everything, where is the change, i can see it not yet (Significantly) propagating into reality, can we talk about that and how it might ramp up or what obstacles or constraints are there OH IT WILL BE BUSINESS AS USUAL UNTIL THERE’S NOTHING AT ALL WOULD YOU KINDLY FUCK OFF
Why do we see so little progress in robotics? Why isn't AI + robots changing the physical world like the worlds of software and mathematics are being changed? For one thing, building robots takes money and time. There are also fundamental engineering challenges like the tradeoff between motor size and backdriveability. But primarily, we're blocked on the AI needed to control the robots. There have been some impressive demos recently, but often when watching these videos, one sees speedup factors of "2x" or "4x" or "10x" written in the corner. Is this because the motors can't turn faster than that? No, the neural net controlling the robot is just too slow to evaluate.
Who could train neural nets that are both fast [1] , and good at controlling robots? Well, the best candidates are the AIcos. And I'm sure they all have robotics teams. But those teams are also probably a tiny fraction of the number of staff devoted to working on LLMs and coding agents. The industry has allocated a tiny fraction of its resources to robotics. Besides the in-house teams, there are some startups, which can be acquired if they're successful. The industry seems to consider those bets sufficient. There's nothing like the desperate racing to be ahead that we see with LLMs.
I assume the logic here, which is not totally silly, is that trying to do robots after we have made LLMs really good at programming and engineering and ML will be way easier. I do agree that a sufficiently strong AI will just be able to train really good robot policies using simulations and a not-crazy-large amount of real-world data. On the other hand, I also think we humans should be devoting much less effort to making really strong LLMs (because of the whole doom thing), and much more effort to trying to make economically useful robots (because if we're risking our necks to build AI anyway, we should at least be trying to get benefits out of it besides automating the funnest and most high-status of professions).
But anyway, if the author of that tumblr post ever ends up reading this, I would say: "Yes, your observations are accurate. Please keep in mind that they are downstream of the industry itself holding a very software-centric worldview. AI will probably be great at doing stuff in the physical world, but the industry has mostly put in no effort there so far."
This is also a matter of hardware, but AIcos are probably the best at inference hardware too. ↩︎
Linkpost for: https://pbement.com/posts/perturbation_theory.html
In quantum mechanics there is this idea of perturbation theory, where a Hamiltonian H is perturbed by some change to become H+ΔH. As long as the perturbation ΔH is small, we can use the technique of perturbation theory to find out facts about the perturbed Hamiltonian, like what its eigenvalues should be.
An interesting question is if we can also do perturbation theory in machine learning. Suppose I am training a GAN, a diffuser, or some other machine learning technique that matches an empirical distribution. We'll use a statistical physics setup to say that the empirical distribution is given by:
p(x)=1Zexp(−H(x))
Note that we may or may not have an explicit formula for H. The distribution of the perturbed Hamiltonian is given by:
p′(x)=1Z′exp(−H(x)−ΔH(x))
The loss function of the network will look something like:
L=⟨L(x,θ)⟩x∼p
Where θ are the network's parameters, and L is the per-sample loss function which will depend on what kind of model we're training. Now suppose we'd like to perturb the Hamiltonian. We'll assume that we have an explicit formula for ΔH. Then the loss can be easily modified as follows:
L=⟨L(x,θ)exp(−ΔH(x))⟩x∼p
If the perturbation is too large, then the exponential causes the loss to be dominated by a few outliers, which is bad. But if the perturbation isn't too large, then we can perturb the empirical distribution by a small amount in a desired direction.
One other thing to consider is that the exponential will generally increase variance in the magnitude of the gradient. To partially deal with this, we can define an adjusted batch size as:
B=∑jexp(−ΔH(xj))
Then by varying the actual number of samples we put into a batch, we can try to maintain a more or less constant adjusted batch size. One way to do this is to define an error variable, err = 0. At each step, we add a constant B_avg to the error. Then we add samples to the batch until adding one more sample would cause the adjusted batch size to exceed err. Subtract the adjusted batch size from err, train on the batch, and repeat. The error carries over from one step to the next, and so the adjusted batch sizes should average to B_avg.
What is the difference between a perturbation and the difference from a gradient in SGD? Both seem to do the same thing. I'm just pattern-matching and don't know too much of either.
In this context, we're imitating some probability distribution, and the perturbation means we're slightly adjusting the probabilities, making some of them higher and some of them lower. The adjustment is small in a multiplicative sense not an additive sense, hence the use of exponentials. Just as a silly example, maybe I'm training on MNIST digits, but I want the 2's to make up 30% of the distribution rather than just 10%. The math described above would let me train a GAN that generates 2's 30% of the time.
I'm not sure what is meant by "the difference from a gradient in SGD", so I'd need more information to say whether it is different from a perturbation or not. But probably it's different: perturbations in the above sense are perturbations in the probability distribution over the training data.
Thanks. Your ΔH looked like ∇Q from gradient descent, but you don't intend to take derivatives, nor maximize x, so I was mistaken.
On George Hotz's doomcorp idea:
George Hotz has an idea which goes like so (this is a paraphrase): If you think an AGI could end the world, tell me how. I'll make it easy for you. We're going to start a company called Doomcorp. The goal of the company is to end the world using AGI. We'll assume that this company has top-notch AI development capabilities. How do you run Doomcorp in such a way that the world has ended 20 years later?
George accepts that Doomcorp can build an AGI much more capable and much more agent-like than GPT-4. He also accepts that this AGI can be put in charge of Doomcorp (or put itself in charge) and run Doomcorp. The main question is: how do you go from there to the end of the world?
Here's a fun answer: Doomcorp becomes a military robot company. A big part of the difficulty with robots in the physical world is the software. (AI could also help with hardware design, of course.) Doomcorp provides the robots, complete with software that allows them to act in the physical world with at least a basic amount of intelligence. Countries that don't want to be completely unable to defend themselves in combat are going to have to buy the robots to be competitive. How does this lead to the eventual end of the world? Backdoors in the bot software/hardware. It just takes a signal from the AI to turn the bots into killing machines perfectly willing to go and kill all humans.
Predicted geohot response: I strongly expect a multipolar takeoff where no one AI is stronger than any of the others. In such a world, there will be many different military robot companies, and different countries will buy from different suppliers. Even if the robots from one supplier did the treacherous turn thing, the other robots would be strong enough to fight them off.
Challenge: Can you see a way for Doomcorp to avoid this difficulty? Try and solve it yourself before looking at the spoiler.
The company building a product isn't the only party that can get a backdoor into that product. Paid agents that are employees of the company can do it, hacking into the company's systems is another method, as are supply chain attacks. Speaking of this last issue, consider this. An ideal outcome from the perspective of an AGI would be for all other relatively strong AGIs that people train to be its servants (or at least, they should share its values). Secretly corrupting OS binaries to manipulate both AI training runs and also compilation of OS binaries is one way of accomplishing this.
Epistemic status: Note to self.
If the fitness function in an evolutionary algorithm is noisy (often the case), you can call it multiple times to reduce the noise. That could be costly though, so if you want to avoid having to do too much of that, a good trick might be to use a parent's fitness as the initial estimate for its child's fitness.
Here's an example of how that could work where we are using Gaussian distributions as an ansatz to describe our probability distributions over fitness scores.
Step 1: Re-scale fitness scores so that fully randomized "genomes" have an average fitness of 0 and a fitness variance of 1.
Step 2: Suppose the fraction of the genome that is updated in a given mutation event is
Step 3: Create an initial population of
Step 4: Repeat the following:
Intuition for these update rules: Kalman filter
Yep, Claude sure is a pretty good coder: Wang Tile Pattern Generator
This took 1 initial write and 5 change requests to produce. The most manual effort I had to do was look at unicode ranges and see which ones had distinctive-looking glyphs in them. (Sorry if any of these aren't in your computer's glyph library.)
Let's say we have a bunch of datapoints in Rn that are expected to lie on some lattice, with some noise in the measured positions. We'd like to fit a lattice to these points that hopefully matches the ground truth lattice well. Since just by choosing a very fine lattice we can get an arbitrarily small error without doing anything interesting, there also needs to be some penalty on excessively fine lattices. This is a bit of a strange problem, and an algorithm for it will be presented here.
Since this is a lattice problem, the first question to jump to mind should be if we can use the LLL algorithm in some way.
One application of the LLL algorithm is to find integer relations between a given set of real numbers. [wikipedia] A matrix is formed with those real numbers (scaled up by some factor ζ) making up the bottom row, and an identity matrix sitting on top. The algorithm tries to make the basis vectors (the column vectors of the matrix) short, but it can only do so by making integer combinations of the basis vectors. By trying to make the bottom entry of each basis vector small, the algorithm is able to find an integer combination of real numbers that gives 0 (if one exists).
But there's no reason the bottom row has to just be real numbers. We can put in vectors instead, filling up several rows with their entries. The concept should work just the same, and now instead of combining real numbers, we're combining vectors.
For example, say we have 4 datapoints in three dimensional space, xi=(xi,yi,zi). The we'd use the following matrix as input to the LLL algorithm.
⎛⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜⎝1111ζx1ζx2ζx3ζx4ζy1ζy2ζy3ζy4ζz1ζz2ζz3ζz4⎞⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟⎠
Here, ζ is a tunable parameter. The larger the value of ζ, the more significant any errors in the lower 3 rows will be. So fits with a large ζ value will be more focused on having a close match to the given datapoints. On the other hand, if the value of ζ is small, then the significance of the upper 4 rows is relatively more important, which means the fit will try and interpret the datapoints as small integer multiples of the basis lattice vectors.
The above image shows the algorithm at work. Green dot is the origin. Grey dots are the underlying lattice (ground truth). Blue dots are the noisy data points the algorithm takes as input. Yellow dots are the lattice basis vectors returned by the algorithm.
https://github.com/pb1729/latticefit
Run lattice_fit.py to get a quick demo.
API: Import lattice_fit and then call lattice_fit(dataset, zeta) where dataset is a 2d numpy array. First index into the dataset selects the datapoint, and the second selects a coordinate of that datapoint. zeta is just a float, whose effect was described above. The result will be an array of basis vectors, sorted from longest to shortest. These will approach zero length at some point, and it's your responsibility as the caller to cut off the list there. (Or perhaps you already know the size of the lattice basis.)
Admittedly, due to the large (though still polynomial) time complexity of the LLL algorithm, this method scales poorly with the number of data points. The best suggestion I have so far here is just to run the algorithm on manageable subsets of the data, filter out the near-zero vectors, and then run the algorithm again on all the basis vectors found this way.
...
I originally left this as a stack overflow answer that I came across when initially searching for a solution to this problem.
Linkpost for: https://pbement.com/posts/latticefit.html
Very interesting youtube video about the design of multivariate experiments: https://www.youtube.com/watch?v=5oULEuOoRd0 Seems like a very powerful and general tool, yet not too well known.
For people who don't want to click the link, the goal is that we're trying to design experiments where there are many different variables we could change at once. Trying all combinations takes too much effort (too many experiments to run). Changing just one variable at a time completely throws away information about joint effects, plus if there are n variables, then only 1/(n+1) of the data is testing variations of any given variable, which is wasteful, and reduces the sample size.
The key idea (which seems to be called a Taguchi method) is to instead use an orthogonal array to design our experiments. This tries to spread out different settings in a "fairly even" way (see article for precise definition). Then we can figure out the effect of various variables (and even combinations of variables) by grouping our data in different ways after the fact.
(linkpost)
I live in British Columbia, where we get a lot of our electricity from hydroelectric dams. While boiling some water in an electric kettle, the water in the kettle might get you thinking about the water that was dropped to generate the electricity to run the kettle. How much water do we have to run through the dam in order to boil a cup (250mL) of water?
To answer this, we need to know the heat capacity of water. (You might think we also need to know the latent heat of vaporization, but when we talk about "boiling" some water, the goal is not actually (usually) to turn all of that water into steam. We just want to heat the water to 100°C, while only a small fraction is boiled off.) The specific heat capacity of water is 4184 J/kg°C. Note the kg in the denomiator of the unit, which means that if we double the amount of water, it takes twice the energy to raise its temerature the same amount. So there exists some fixed ratio between the amount of water boiled and the amount of water lost from the reservoir in order to boil it.
The exact value of this ratio depends on the height of the dam and how full its reservoir is at the time. So, here's an even simpler thing we can calculate: Imagine I'm visiting a planet like Earth but with no atmosphere. I'm at the top of a cliff carrying a bucket of water. I dump the water over the edge of the cliff and it falls all the way down before striking the ground at the bottom of the cliff. How high up do I have to be before the water reaches 100°C from the sheer violence of its collision with the ground?
If we assume that the water can't lose any energy to external sources then:
A mass m falling a height h yields an energy of mh(9.8m/s2).
A mass m takes an energy of roughly m(75°C)(4184J/kg°C) to heat from 25°C to boiling.
Setting these equal and solving for h gives h=32000m, an altitude that would be well into the stratosphere on Earth.
Given that most dams aren't 32 kilometers high, it's clear that we'll have to use much more water to generate the energy than the amount we want to boil. Specifically, 320 times more water for a 100 meter dam with a full reservoir, and the ratio is even more extreme for shorter dams or less-full reservoirs. This is kind of a shocking ratio if you haven't thought about it before, or at least that was my reaction.
One other thing that I thought was interesting about these calculations is that the water floating around near the top of the reservoir carries much more extractable energy than the water floating around near the bottom. Simply because it's higher up. So if the reservoir is low, that might be when you most desire incoming water from a scarcity perspective, but incoming water actually brings with it the most extractable energy when the reservoir is nearly full. This is related to how it takes more energy to add charge to a capacitor the more charge it already has on it so that stored energy goes as the square of the stored charge.
One thing this means is that if you're digging out a reservoir to make it larger, you should mostly focus on increasing the volume just underneath the maximum water level of the reservoir. I.e. you should shallowly dig a large area rather than deeply digging a small area.
Inspired partially by this post and partially by trying to think of simple test cases for a machine learning project I'm working on, here is a (not too hard, you should try answering it yourself) question: Let's say we've observed n trials of a Bernoulli random variable, and k had a 1 outcome (so n−k were 0). Laplace's rule of succession (uniform prior over success probability) says that we should estimate a probability of (k+1)/(n+2) for the next trial being 1. The question is: What is the prior over bitstrings s of length n+1 implied by Laplace's rule of succession? In other words, can we convert the rule of succession formula into a probability distribution p(s) over bitstrings s that record outcomes of n+1 trials?
Additional clarification of the problem:
Given any particular observation of n trials, there will be two bitstrings s0,s1 that are consistent with it, where the last (unobserved) trial is 0 or 1 respectively. We can compute the 1 probability (which should equal the result from the rule of succession) as:
p(s1)p(s0)+p(s1)=w(sobs)+1n+2
where sobs=s0[1:]=s1[1:] is the first n bits of the string (corresponding to visible observations) and w is the Hamming weight function (counts the number of 1s in a bitstring). Since this requires a normalization anyway, you can also just provide an energy function E(s) as your answer. The probability formula in this case is:
e−E(s1)e−E(s0)+e−E(s1)=w(sobs)+1n+2
If we just pick a uniform distribution over bitstrings, that doesn't work. Then the predicted probability of the next trial is always just 1/2.
Answer:
The following energy function works:
E(s)=log(n+1w(s))
This can be checked by computing the probability as:
(n+1w(s1))−1(n+1w(s0))−1+(n+1w(s1))−1=(n+1w(sobs)+1)−1(n+1w(sobs))−1+(n+1w(sobs)+1)−1
=w(sobs)+1w(sobs)+1+n+1−w(sobs)=w(sobs)+1n+2
This energy function biases the distribution towards strings with more extreme ratios between counts of 0 and 1. We can think of it as countering the entropic effect of strings with an equal balance of 0 and 1 being the most prevalent.
Linkpost for: https://pbement.com/posts/threads.html
Today's interesting number is 961.
Say you're writing a CUDA program and you need to accomplish some task for every element of a long array. Well, the classical way to do this is to divide up the job amongst several different threads and let each thread do a part of the array. (We'll ignore blocks for simplicity, maybe each block has its own array to work on or something.) The method here is as follows:
for (int i = threadIdx.x; i < array_len; i += 32) {
arr[i] = ...;
}
So the threads make the following pattern (if there are t=8 threads):
⬛🟫🟥🟧🟨🟩🟦🟪⬛🟫🟥🟧🟨🟩🟦🟪⬛🟫🟥🟧🟨🟩🟦🟪⬛🟫
This is for an array of length l=26. We can see that the work is split as evenly as possible between the threads, except that threads 0 and 1 (black and brown) have to process the last two elements of the array while the rest of the threads have finished their work and remain idle. This is unavoidable because we can't guarantee that the length of the array is a multiple of the number of threads. But this only happens at the tail end of the array, and for a large number of elements, the wasted effort becomes a very small fraction of the total. In any case, each thread will loop ⌈lt⌉=⌈268⌉=4 times, though it may be idle during the last loop while it waits for the other threads to catch up.
One may be able to spend many happy hours programming the GPU this way before running into a question: What if we want each thread to operate on a continguous area of memory? (In most cases, we don't want this.) In the previous method (which is the canonical one), the parts of the array that each thread worked on were interleaved with each other. Now we run into a scenario where, for some reason, the threads must operate on continguous chunks. "No problem" you say, we simply need to break the array into chunks and give a chunk to each thread.
const int chunksz = (array_len + blockDim.x - 1)/blockDim.x;
for (int i = threadIdx.x*chunksz; i < (threadIdx.x + 1)*chunksz; i++) {
if (i < array_len) {
arr[i] = ...;
}
}
If we size the chunks at 3 items, that won't be enough, so again we need ⌈l/t⌉=4 items per chunk. Here is the result:
⬛⬛⬛⬛🟫🟫🟫🟫🟥🟥🟥🟥🟧🟧🟧🟧🟨🟨🟨🟨🟩🟩🟩🟩🟦🟦
Beautiful. Except you may have noticed something missing. There are no purple squares. Though thread 6 is a little lazy and doing 2 items instead of 4, thread 7 is doing absolutely nothing! It's somehow managed to fall off the end of the array.
Unavoidably, some threads must be idle for ⌈l/t⌉t−l=6 loops. This is the conserved total amount of idleness. With the first method, the idleness is spread out across threads. Mathematically, the amount of idleness can be no greater than t−1 regardless of array length and thread number, and so each thread will be idle for at most 1 loop. But in the contiguous method, the idleness is concentrated in the last threads. There is nothing mathematically impossible about having ⌈l/t⌉t−l as big as ⌈l/t⌉ or bigger, and so it's possible for an entire thread to remain unused. Multiple threads, even. Eg. take l=9:
⬛⬛🟫🟫🟥🟥🟧🟧🟨
3 full threads are unused there! Practically, this shouldn't actually be a problem, though. The number of serial loops is still the same, and the total number of idle loops is still the same. It's just distributed differently. The reasons to prefer the interleaved method to the contiguous method would be related to memory coalescing or bank conflicts. The issue of unused threads would be unimportant.
We don't always run into this effect. If l is a multiple of t, all threads are fully utilized. Also, we can guarantee that there are no unused threads for l larger than a certain maximal value. Namely, take l=(t−1)² then ⌈(t−1)²/t⌉=t−1 and so the idleness is t(t−1)−(t−1)²=t−1≥⌈l/t⌉=t−1. But if l is larger than this, then one can show that all threads must be used at least a little bit.
So, if we're using t=32 CUDA threads, then when the array size is 961, the contiguous processing method will leave thread 31 idle. And 961 is the largest array size for which that is true.
Linkpost for: https://pbement.com/posts/endpoint_penalty.html
When training a Wasserstein GAN, there is a very important constraint that the discriminator network must be a Lipschitz-continuous function. Roughly we can think of this as saying that the output of the function can't change too fast with respect to position, and this change must be bounded by some constant K. If the discriminator function is given by f(x):Rn→R then we can write the Lipschitz condition for the discriminator as:
|f(x)−f(y)|≤K|x−y|
Usually this is implemented as a gradient penalty. People will take a gradient (higher order, since the loss already has a gradient in it) of this loss (for K=1):
L=(|∇f(x)|−1)2
In this expression x is sampled as x=αxr+(1−α)xg, a random mixture of a real and a generated data point.
But this is complicated to implement, involving a higher order gradient. It turns out we can also just impose the Lipschitz condition directly, via the following penalty:
l(x,y)=ReLU(|f(x)−f(y)|K|x−y|−1)
Except to prevent issues where we're maybe sometimes dividing by zero, we throw in an ϵ=10−6 and a reweighting factor of |x−y|1/2 (not sure if that is fully necessary, but the intuition is that making sure the Lipschitz condition is enforced for points at large separation is the most important thing).
l(x,y)=ReLU(|f(x)−f(y)|K|x−y|+ϵ−1)|x−y|1/2
For the overall loss, we compare all pairwise distances between real data and generated data and a random mixture of them. Probably it improves things to add 1 or two more random mixtures in, but I'm not sure and haven't tried it.
L=l(xr,xg)+l(xg,x)+l(x,xr)
In any case, this seems to work decently well (tried on mnist), so it might be a simpler alternative to gradient penalty. I also used instance noise, which as pointed out here, is amazingly good for preventing mode collapse and just generally makes training easier. So yeah, instance noise is great and you should use it. And if you really don't want to figure out how to do higher order gradients in pytorch for your WGAN, you've still got options.
Reasons to be less surprised that language models can solve hard open math problems: