HNHacker News
TopNewBestAskShowJobs

pash

3,408 karma · joined May 28, 2011

I do quant-finance and ML things, write Haskell, and ride bicycles. I also do other things, but less often.
submissionscomments
pash··on Anecdotally, programmers dislike "reduce"
In other words, look at the types. The type of the folding function (the first argument) indicates how each fold works.

  foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b

  foldr  :: Foldable t => (a -> b -> b) -> b -> t a -> b
pash··on The Microeconomics of Artificial Intelligence (2025)
Yes, Ricardo originally introduced the idea of comparative advantage in the context of international trade, in a model in which different countries had different endowments of resources.

Nothing that imtringued wrote above suggests he understands comparative advantage, which is the idea that it is relative productivity, not absolute productivity, that should determine what one specializes in. That’s precisely what I meant about people finding the concept unintuitive.

pash··on The Microeconomics of Artificial Intelligence (2025)
Essentially all of economic theory is aimed at explaining, not predicting. The distinction between the two goals [0] is sometimes under-appreciated within the profession, and almost always under-appreciated outside of it.

Most predictive tools in economics and finance have “surprisingly” little economic content; but once you understand the distinction between the two goals, it should be unsurprising that predictive models tend to make few economic assumptions, relying rather on general statistical techiniques or on econometrics that incorporate a minimum of theory [1]. From that understanding comes the humbling realization that predicting the future is quite difficult in a context in which the relevant processes are continually seeking an equilibrium that often implies unpredictability. [2]

I’m not an economist, but I do a lot of applied financial-economic modeling. State-of-the-art LLMs are really, really terrible at economic intuition. They will hinder, not help, in formulating an economic model, which is a process of coming up with a set of modeling assumptions that lead to a useful (implicitly, tractable) model. LLMs are, however, quite good at math, and I’ve found them very useful in iterating through different sets of modeling assumptions to identify those that lead somewhere useful. Not having to work out all of the mathematical details myself, and thereby avoiding getting lost in the weeds and being better able to maintain a higher-level perspective on what I’m trying to accomplish, has accelerated my work immensely. But it’s a process of leading the LLM by the nose the whole time and asking it to fill in the details.

I should note, thought, that if you indotend “AI” to mean more than LLMs, them yes, there is starting to be a lot of good work done on predictive economic models that use specialized neural networks as black-box functions to compute model quantities that are otherwise difficult to come up with, just as is also happening in applied physics and other fields.

0. https://www.stat.berkeley.edu/~aldous/157/Papers/shmueli.pdf

1. Many explanatory economic models refer to quantities that are fundamentally or practically unobservable or unidentifiable. Much of economics is built on models that were designed to provide a formal, logical basis for understanding the economic world, which is often quite unintuitive. (For example, many intelligent people uneducated in economics exhibit intuitions opposite of basic economic ideas like opportunity cost or comparative advantage.) Models of this sort have been very influential in determining the trajectory of economic thought, but they are often effectively impossible to calibrate to the real world.

2. The most influential and effective economic ideas fall into a third class: ideas that have created their own reality by shaping the way people think in a way that gives rise to the results the models explain or predict. This phenomenon is most evident in finance, where ideas like the various forms of the efficient market hypothesis, the CAPM, and the Black–Scholes model and its follow-one have arguably provided a framework that has reshaped the ways financial practitioners behave to such an extent that financial markets now conform much more closely to what the models describe than was formerly the case. Donald MacKenzie’s book An Engine, Not a Camera is an excellent study of this phenomenon: https://mitpress.mit.edu/9780262633673/an-engine-not-a-camer...

pash··on Holden's Lightning Flight
I think the joke is that Air Marshal Kenneth Porter was chief of the RAF’s maintenance command, and also not a pilot. [0]

Edit: fergal_reid’s reply below is correct. Porter did serve several years at the start of his career as a pilot, in the early 1930s, before spending the bulk of it as a signals officer. Holden also had his wings, but never served as a pilot. I read Porter’s comment as a joke between two RAF officers who were not “really” pilots, but now I’m not sure how to read it.

0. https://en.wikipedia.org/wiki/Kenneth_Porter_(RAF_officer)

pash··on Octopus intelligence may be related to never-before-seen mutation
What does it mean to “produce proteins with about twice their usual accuracy”? Smaller feature size, essentially?
pash··on You can just say it
Right, that’s why I wrote, “I don’t mean that most neural networks are invertible functions.”

For a neural network that is not bijective, you can obtain an input that maps to a desired output by the following algorithm.

1. Start with a trained neural network. (The weights will not change throughout this procedure.)

2. Pick a random input.

3. Given an output for which you want to compute an associated input, feed the input into the network to compute the output.

4. Compute the loss of the computed output relative to the target output (e.g., mean-square error). If the loss is sufficiently small, you’ve found an input that maps to an output close to your target output and you’re done.

5. Otherwise, compute the gradient of the loss with respect to the input (e.g., by backprop).

6. Update the input according to a gradient-update rule. And go back to Step 3.

In theory, you can recover a “representative” prompt for the output of an LLM in this manner. For outputs that could have been generated by a large set of disparate prompts, obviously this won’t work well.

pash··on You can just say it
The obvious solution is to run things in reverse, inputting the AI-generated output to recover the prompt that generated it.

Most generative models can be run in reverse by algorithms that already exist [0], but you have to have the model weights. For closed-weight models, or for a process that can handle unknown models, you’d have to do some engineering.

But do we have the technology to build models that back out the prompt from suspected AI output? Yes.

0. I don’t mean that most neural networks are invertible functions. They’re not. But you can do backprop in reverse, from output to input, to train a model to generate an input to the original model that best predicts its output.

pash··on There Will Be a Scientific Theory of Deep Learning
The inflection point was 2012, when AlexNet [0], a deep convolutional neural net, achieved a step-change improvement in the ImageNet classification competition.

After seeing AlexNet’s results, all of the major ML imaging labs switched to deep CNNs, and other approaches almost completely disappeared from SOTA imaging competitions. Over the next few years, deep neural networks took over in other ML domains as well.

The conventional wisdom is that it was the combination of (1) exponentially more compute than in earlier eras with (2) exponentially larger, high-quality datasets (e.g., the curated and hand-labeled ImageNet set) that finally allowed deep neural networks to shine.

The development of “attention” was particularly valuable in learning complex relationships among somewhat freely ordered sequential data like text, but I think most ML people now think of neural-network architectures as being, essentially, choices of tradeoffs that facilitate learning in one context or another when data and compute are in short supply, but not as being fundamental to learning. The “bitter lesson” [1] is that more compute and more data eventually beats better models that don’t scale.

Consider this: humans have on the order of 10^11 neurons in their body, dogs have 10^9, and mice have 10^7. What jumps out at me about those numbers is that they’re all big. Even a mouse needs hundreds of millions of neurons to do what a mouse does.

Intelligence, even of a limited sort, seems to emerge only after crossing a high threshold of compute capacity. Probably this has to do with the need for a lot of parameters to deal with the intrinsic complexity of a complex learning environment. (Mice and men both exist in the same physical reality.)

On the other hand, we know many simple techniques with low parameter counts that work well (or are even proved to be optimal) on simple or stylized problems. “Learning” and “intelligence”, in the way we use the words, tends to imply a complex environment, and complexity by its nature requires a large number of parameters to model.

0. https://en.wikipedia.org/wiki/AlexNet

1. https://en.wikipedia.org/wiki/Bitter_lesson

pash··on The buns in McDonald's Japan's burger photos are all slightly askew
https://en.wikipedia.org/wiki/Sprezzatura

https://en.wikipedia.org/wiki/Wabi-sabi

pash··on Billion-Parameter Theories
> Even for billion-parameter theories, a small amount of vectors might dominate the behaviour.

We kinda-sorta already know this is true. The lottery-ticket hypothesis [0] says that every large network contains a randomly initialized small network that performs as well as the overall network, and over the past eight years or so researchers have indeed managed to find small networks inside large networks of many different architectures that demonstrate this phenomenon.

Nobody talks much about the lottery-ticket hypothesis these days because it isn’t practically useful at the moment. (With the pruning algorithms and hardware we have, pruning is more costly than just training a big network.) But the basic idea does suggest that there may be hope for interpretability, at least in the odd application here or there.

That is, the (strong) lottery-ticket hypothesis suggests that the training process is a search through a large parameter space for a small network that already (by random initialization) exhibit the overall desired network behavior; updating parameters during the training process is mostly about turning off the irrelevant parts of the network.

For some applications, one would think that the small sub-network hiding in there somewhere might be small enough to be interpretable. I won’t be surprised if some day not too far into the future scientists investigating neural networks start to identify good interpretable models of phenomena of intermediate complexity (those phenomena that are too complex to be amenable to classic scientific techniques, but simple enough that neural networks trained to exhibit the phenomena yield unusually small active sub-networks).

0. https://en.wikipedia.org/wiki/Lottery_ticket_hypothesis

pash··on Agent Safehouse – macOS-native sandboxing for local agents
Sandvault [0] (whose author is around here somewhere), is another approach that combines sandbox-exe with the grand daddy of system sandboxes, the Unix user system.

Basically, give an agent its own unprivileged user account (interacting with it via sudo, SSH, and shared directories), then add sandbox-exe on top for finer-grained control of access to system resources.

0. https://github.com/webcoyote/sandvault

pash··on Let's discuss sandbox isolation
OK, let’s survey how everybody is sandboxing their AI coding agents in early 2026.

What I’ve seen suggests the most common answers are (a) “containers” and (b) “YOLO!” (maybe adding, “Please play nice, agent.”).

One approach that I’m about to try is Sandvault [0] (macOS only), which uses the good old Unix user system together with some added precautions. Basically, give an agent its own unprivileged user account and interact with it via sudo, SSH, and shared directories.

0. https://github.com/webcoyote/sandvault

pash··on Ireland rolls out basic income scheme for artists
Milton Friedman wouldn’t have approved of a basic-income scheme restricted to artists. He would have argued that restricting the benefit to artists would distort incentives for choosing a profession in a way likely to reduce social welfare, and that eligibility by profession is a “welfare trap”: it’s hard to stop being an artist and start being something else when it means losing your guaranteed income.

But Friedman would have supported a broad basic-income scheme. We know this because he did support one. It was his proposal in 1962 of a “negative income tax” [0] (in Capitalism and Freedom) that gave rise to the movement to replace traditional social welfare programs with simple schemes that just give money to poor people. (This movement led to the Earned Income Tax Credit [1] in the United States.)

Friedman’s negative income tax is equivalent to the contemporary notion of a guaranteed basic income (but not to a universal basic income, as only people earning below some threshold would receive it). Like most economists, Friedman believed that people (even poor people) can typically make their own economic choices better than a government program can make those choices for them. (He was likewise not opposed to redistributive policies per se.) That was the root of his advocacy for market-based mechanisms of organizing the economy.

0. The idea dates to at least the 1940’s, but Friedman’s book is typically credited with popularizing it. See, e.g, https://en.wikipedia.org/wiki/Negative_income_tax.

1. https://en.wikipedia.org/wiki/Earned_income_tax_credit

pash··on A battle over Canada’s mystery brain disease
From what I understand, which is very incomplete, the leading hypothesis at the moment is that ingested prions are a bit hard to digest (because they’re malformed proteins), so they end up making it out of the gastrointestinal tract somehow, interacting with the nervous system via the intestinal lining or lymphatic system. Then they travel to the brain via nervous pathways, by-passing the usual blood–brain barrier.

But transmission of prions by ingestion is thought to be quite rare, as that mechanism suggests. Transmission by any means seems to be quite rare, even heritable transmission (e.g., vCJD). So that’s why it seems unlikely that whatever is happening in New Brunswick is CVD.

But if it’s not some minor mass hysteria, then maybe prions.

pash··on A battle over Canada’s mystery brain disease
I’m not qualified to comment intelligently on what might be going on here, but I’d like to add some background color that the article lacks.

Creutzfeldt–Jakob Disease is a prion disease [0] for which there is no definitive diagnosis in vivo. A confident diagnosis can be made only after examining brain tissue under a microscope.

Prions are an unusual type of mis-folded protein that induce other proteins to take on a similar mis-folded shape when they come into contact with them. The mis-folded shape of the prion itself is what causes the mis-folding in adjacent proteins. It’s a chemical-bonding thing at the molecular level. It’s the shape of the prion that causes other proteins to take on a similar shape and become prions, etc.

Some prion diseases occur spontaneously (when a protein takes on a mis-folded configuration due to mis-transcription or random energetic impulses) and some are transmitted, typically by eating some part of an animal that contains prions, which then end up in your own body, inducing proteins in your body to take on prion configurations.

Prion diseases are the only known transmissible diseases that do not involve the replication of a pathogen’s genetic material in a host cell. The only known prion diseases affect nervous tissues, and in humans the only known prion diseases affect brain tissues.

I’m not an expert on prion diseases, but I’ve had a bit of a fascination with them since having to report on a bunch of USDA surveillance lectures on mad-cow disease (bovine spongiform encephalopathy, BSE) and to summarize a bunch of symposia on prion diseases in a previous life. The symptoms reported in the article sound very much like a prion disease, and the tests for CJD indicate that the doctors in the region suspect as much.

But we simply don’t have good tests for prion diseases in vivo. And prion diseases are not well understood in general, so it wouldn’t be surprising that a new one would present as something of a mystery.

It is also the case that I know very little about New Brunswick, but I will mention that prion diseases in humans are thought to be far more commonly acquired than spontaneous. The most common cause of acquisition is eating animals with endemic prion diseases; this is most often nervous tissue of venison, but rarely nervous tissue of cattle infected with BSE, which is present in Canada more than anywhere else (by a small margin).

It is also possible (but not likely) that a prion disease can arise de novo.

0. https://en.wikipedia.org/wiki/Prion_disease

pash··on How elites could shape mass preferences as AI reduces persuasion costs
Philip E Converse, The Nature of Belief Systems in Mass Publics (1964), 75 pages [0].

0. https://web.ics.purdue.edu/~hoganr/Soc%20312/The%20nature%20... [PDF]

pash··on The bloat of edge-case first libraries
> We should be able to define our functions to accept the inputs they are designed for, and not try to handle every possible edge case.

Oh, look, somebody just re-discovered static typing.

pash··on Simulating and Visualising the Central Limit Theorem
For some definition of “sufficiently introductory”, I’d recommend starting with the first chapter of John Nolan’s book Stable Distributions [0] (20 pages), which presents the class of distributions to which sums of iid random variables converge and builds up to a version of the generalized CLT.

Note that this generalization of the classical CLT relaxes the requirement of finite mean and variance but still requires that the summed random variables are iid. There are further generalizations to sums of dependent random variables. John D. Cook has a good blog post that gives a quick overview of these generalizations [1].

0. https://edspace.american.edu/jpnolan/wp-content/uploads/site... [PDF]

1. https://www.johndcook.com/blog/central_limit_theorems/

pash··on Mustard Watches (1990)
I’m not sure what the author had in mind when he wrote the paper, but its light-hearted content reveals well how to structure a math paper: (1) state the problem and why the reader should care about it, (2) state how the paper builds on prior work, (3) summarize the main results, and then (4) develop them in theorem-proof style.

An economics paper in the same spirit (though of course economics addresses more practical problems than mathematics, in this case whether one should leave the toilet seat up or down) shows quite well how to present and develop an economic model [0].

0. https://jaypilchoi.com/wp-content/uploads/2021/06/Economic-I... [PDF]

pash··on The Lost Art of Logarithms
The general version of this is called inverse transform sampling [0], which uses the fact that for the cdf F of any random variable X the random variable Y = F(X) has a standard uniform distribution [1]. Since every cdf increases monotonically on the unit interval, every cdf is invertible [2]. So apply the inverse cdf to both sides of the previous equation and you get F^-1(Y) = X is distributed like X.

Sampling from a standard uniform distribution and then using the inverse transform is the commonest way of generating random numbers from an arbitrary distribution.

0. https://en.m.wikipedia.org/wiki/Inverse_transform_sampling

1. https://en.m.wikipedia.org/wiki/Probability_integral_transfo...

2. Not every cdf is one-to-one, however, so you may need a generalized inverse.

pash··on The war on remote work has nothing to do with productivity
The Fed’s estimates thru 2022 say real estate makes up 46.8% of net US wealth ($83.5 trillion of $178.4 trillion) [0].

0. Readably summarized at https://www.barrons.com/amp/articles/net-wealth-is-over-135-... .

pash··on Direct evidence of the use of multiple drugs in Bronze Age from human hair test
Yes, it’s a bit surprising. The whole point of a constitution is to provide a groundwork and a set of meta-rules governing how the ordinary rules of society may be made and modified, and how disputes about those sorts of thing should be resolved. The judiciary is precisely the mechanism for entertaining and deciding these disputes.

The odd thing, really, is that it took a decade and a half, until 1803, for the Supreme Court first to find it necessary to tell another of the other branches of government that it had broken the rules.

pash··on Direct evidence of the use of multiple drugs in Bronze Age from human hair test
Article III, Sec. 2, clearly, which begins:

> The judicial Power shall extend to all Cases, in Law and Equity, arising under this Constitution …

Let’s not continue this conversation. The view I’m presenting is long established and can be found better and much more extensively made in a great many sources which no one should have any trouble finding, should he wish. You, I infer, do not wish.

pash··on Direct evidence of the use of multiple drugs in Bronze Age from human hair test
The role of the courts in deciding the constitutionality of legislation was very much in the zeitgeist of the American experiment. Federalist, No. 78:

> It is not otherwise to be supposed, that the Constitution could intend to enable the representatives of the people to substitute their will to that of their constituents. It is far more rational to suppose, that the courts were designed to be an intermediate body between the people and the legislature, in order, among other things, to keep the latter within the limits assigned to their authority. [0]

It is absurd to say that the Supreme Court “magicked out of thin air” the notion of judicial review in Marbury v. Madison. That was simply the Court's first assertion of the power the constitution gave it to wield, the wielding of which is the primary purpose of the judiciary as a separate but equal branch of American government.

0. https://en.m.wikipedia.org/wiki/Federalist_No._78#Judicial_r...

pash··on America’s banks are missing hundreds of billions of dollars
You’re right, sorry. Reserve Primary was the only fund whose NAV was below the Treasury’s qualifying threshold, so it did not participate in the guarantee program. I had the mistaken recollection that Reserve Primary’s NAV had returned above the $0.995 level by the 19th, but that was not the case.

(In fact, the SEC ended up suing Reserve Primary’s managers for making misleading statements after breaking the buck that they would restore a $1 NAV, which they did not do. Reserve Primary’s investors had an eventual recovery as of 2011 of 99.06% of par value.)

Of the funds that participated in the Treasury’s guarantee program, none were liquidated likely because the program succeeded in stemming the run on the money-market sector. As I’m sure you know, the whole point of the Treasury’s guarantee was to give money-market investors confidence that their money was safe so that they would not redeem their shares and the funds would not need to liquidate assets for payouts.

It worked, and I think it’s clear that the Treasury’s backstop, by ending the run, prevented fire-sales that likely would have led to the liquidation of further funds in the absence of government intervention. That was the point I was making in my original comment: despite the lack of a formal equivalent of deposit insurance for money-market funds, the government did step in to backstop investor’s money in the sector during the only episode in which there was a need for it.

Edit: Whoops, also noticed that in my original comment above, I twice mis-wrote money-market account. Everything we’ve been discussing relates to money-market funds (more formally, money-market mutual funds), not money-market accounts. The latter term is another name for savings accounts at a bank, which of course are FDIC-insured. (The two are related in that the cash put into both gets invested in short-term, low-risk government and commercial bonds, the markets for which are collectively called “money markets”.)

pash··on An off-kilter visionary: Henry Green had a strange and distinctive talent
Two new writers to read! Interesting, if it’s really the case, that there are only a couple of twentieth-century British novelists whose cult reputations outstrip their wider reputations. I feel like there are a number of American authors who fit that description, e.g., John Barth, William Gaddis.
pash··on America’s banks are missing hundreds of billions of dollars
Yes, really. The Treasury guaranteed dollar-for-dollar redemptions for all investors’ holdings at the time the RPF broke the buck, following Lehman’s failure several days before [0, 1]. Only those who speculated on the value of the fund after that time lost money, and very little.

0. https://home.treasury.gov/news/press-releases/hp1161

1. https://elischolar.library.yale.edu/cgi/viewcontent.cgi?arti...

pash··on America’s banks are missing hundreds of billions of dollars
Money-market accounts are not covered by government deposit insurance. But money-market funds make a return for themselves by investing their customers’ cash in risky assets, similarly to a bank. If there’s a run on your money-market fund akin to the bank runs we’ve recently seen, the FDIC isn’t going to save you.

(Kinda. The other big distinction between a bank and a money-market fund is that the latter don’t indulge the farce of “demand deposits”. Money-market accounts are fixed-term securities, so you’ve agreed to lock up your money until some agreed upon future date, just like with a bond. That might be inconvenient for you, in comparison to a bank account, but it vastly reduces the complexity the fund faces in matching maturities of liabilities and assets to minimize run risk. As a result, together with stricter regulatory controls on their risk-taking, money-market funds fail much less often than banks do. The last time a US money-market fund broke the buck, in 2008, during the last financial crisis, the Treasury stepped in to make investors whole.)

pash··on Finding the B-21's hangar location from the stars in its press image
Northrop Grumman announced in September that they would unveil the B-21 at Palmdale this week [0]. The location was not a secret.

0. https://www.globenewswire.com/news-release/2022/09/20/251965...

pash··on How to learn mathematics: the asterisk method
This is the essence of the method described in the link, and the ability to pull it off is called "mathematical maturity". How one acquires mathematical maturity is the matter of some debate.
Page 1 of 13Next →