Did you get linked straight here? Before you read on, please read the introduction to this series. It’s short, I promise!
Artificial Intelligence is an 80-year-old field covering a lot of ground. At heart it’s the attempt to get computers to perform tasks that we think require cognition: finding paths over terrain or through buildings; playing chess; catching a ball; recognizing handwritten symbols; writing a poem. The addictive lure of this field is that we know that these tasks can all be performed by a single organ in the human body—the brain—and therefore, goes the reasoning, it ought to be possible to replicate its diverse functions in a single machine.
Historically, whenever a task previously believed to require intelligence has been performed by a machine, it is reclassified as not actually requiring intelligence. While that can seem like moving goalposts, it’s often a matter of having rather gained a deeper understanding: when an algorithm is identified that can play chess, for example, that tends to pull back the curtain enough to see that the problem is different than originally thought, sometimes in fascinating ways. Human intelligence can be used to play tic-tac-toe, but it can also be played well (even perfectly) with a set of simple rules. Computer programs can beat chess grandmasters, sure, but enjoying the game isn’t a matter of mathematical perfection; even losing can be fun.1
Artificial Intelligence and machine learning are related, but they’re not synonyms. AI is the broader field and includes many techniques that do not learn. Expert systems, for example, can just be huge piles of rules put together by human experts so that a machine can navigate the process of making a decision, like an enormous and intricate flow chart. Flow charts don’t get better the more you follow them, unless you as a human go back and revise them. Machine learning, by contrast, can be thought of that class of computer programs that improve their performance through exposure to data, without explicit modification by a human programmer.
Custom Perceptrons and Networking
Machine learning too is a wide field with a lot of different techniques and approaches. When people talk about Artificial Intelligence or machine learning right now, though, they mostly mean that subset of machine learning involving artificial neural networks.
Also called “deep learning”, artificial neural networks have been around in some form or another since the 1950s, with precursor work even predating the coining of the term “Artificial Intelligence”. Neural networks are inspired by a somewhat simplistic understanding of biological neurons, dating in part from mathematical representations devised in the 1940s2. These were believed to work in a simple way: A neuron can activate by creating a single electrical signal. Each neuron cell touches some number of other neurons. If a neuron notices some simple pattern in its neighbors’ activations, it too activates. A neural network can do sophisticated things not because any individual neuron is sophisticated, but because massive numbers of them interacting produce remarkable emergent behavior. Modern understanding of neurology shows that this is a too-simplistic understanding of how brains work, but the concept of building up a complex network from simple parts turns out to be very powerful.
An artificial neuron (called a perceptron in Frank Rosenblatt’s original 1958 work) is basically a straightforward mathematical equation. I call it a mathematical equation for a good reason we’ll get into later, but whatever you call it, you’ll often see it drawn like some kind of Sputnik-looking thing, sometimes with a little wave inside.

An artificial neuron is made up of:
- Some input numbers, connected to…
- A simple mathematical function or operation, producing…
- One output number.
This is the point where many explainers also draw a biological neuron for comparison, but I want to distance us from biological neurons a bit. These are not brains being built here.3
Let’s instead play with the simplest perceptron/neuron, with one input number, one output number, and a simple on-off function: if the input is greater than zero, we’ll make the output 1. Otherwise we’ll output 0. That bit of math in the middle4 is sometimes called an activation function: a large enough input “activates” the neuron, mimicking biological neurons.
We can customize neurons. Instead of activating at 0, I can pick any number: if the input number is > 5, say, the output is 1. Since I’m going to want to customize each neuron separately, I’ll want a placeholder for the number which I’ll call that b, and each neuron will have its own b: 0, 5, etc. Now I can string together a sequence of neurons, each with its own b so that a particular neuron activates if its input is greater than b:

I had a very sweet cat once whose neural network probably looked like that, but for anything useful each neuron is going to need more than one input.

It still has just the one output, so it’s not obvious what to do with the second (or third, or…) input. We could multiply them, average them, pick a fancy new function that does different things with each. The philosophy of a neural network is for the complexity to come in at the level of how they’re arranged and connected, though: The goal for a neuron is to be a small and simple part of a large and complicated network. So we’re just going to add all the inputs together. If input 1 added to input 2 is greater than b, set the output to 1.
Now we have a simple counting function: each neuron activates if and only if at least b inputs are 1. Chaining them together now actually makes some sense! Each neuron counts its inputs, so the first neurons in a chain directly count original inputs, while later neurons count previously-activated neurons. Note that we can reuse inputs, too: one number can be sent to multiple other neurons, so the same number can be counted more than once. We’re going to avoid loops, though, because that makes outputs change after they’ve been figured out.

The spirit of a neural network is to build a complex network out of very simple parts, but my parts here are a little bit too simple. I want some of my inputs to count more than others, which I’ll justify in a minute. So I’m going to make another customization: instead of just counting inputs, I’m going to multiply each input by a placeholder I’ll name a with a number. So, the first input to a neuron gets its number multiplied by a1, the second by a2, and so on. Then if the whole thing is more than b, the output is 1. (If you’re starting to get suspicious about that “1” given all the other customizations, hold that thought.)
This arrangement lets me give some inputs more weight in the decision whether a given neuron activates, which gives the network a lot more flexibility. It also lets me just connect up every input to every neuron on my picture, which simplifies designing a big network, since I can just set a given a multiplier to 0 instead of altering the structure to remove a link. But this is a trade-off: I’ve added a bit of complexity in the form of a bunch of custom numbers that I’ll need to keep track of for each neuron, and while ultimately I’ll need that in order to make these work, that cost is going to come back to bite.
Now, that “1” output: I can also change the equation from that on/off function to something a little more flexible: if the sum of the inputs is less than my number b, I’ll output 0 just like before. Otherwise, though, output the input sum itself. That way I preserve some information about whether the inputs together were barely above b, or way above it.5
An analogy might be a farm stand that only charges if the customer wants at least a dollar’s worth of fruit or vegetables in any combination, and the output is how much I charge. Apples (input 1) are 10 cents, bananas (input 2) 50 cents, carrots (input 3) 5 cents, some food that starts with d is 25 cents, etc. So, the first a is 0.1, multiplied by the number of apples, plus 0.5 times the number of bananas, etc. Then the output is either the total cost of the sale (which could be hundreds of dollars but at least $1) OR no sale at all if everything added up is less than a buck. There are many ways to hit that $1, with bananas having the biggest impact on the total. Each neuron/stand charges a different price for each item, though, and has a different threshold for making a sale. Clearly I didn’t go to business school, farm school, or even writing school, but hopefully that makes some intuitive sense. (Donuts! There we go.)
What I’m trying to get across is that we’re talking very basic math that a grade school student could do, but I promise we really are working toward AI here! Armed with my fully customizable neurons, we can now build a huge network that can do real AI tasks. We just first need to organize them a bit.
Layers upon Layers
Let’s expand my diagram from earlier, just a bit, and add some blue dots representing the custom weights for each input. The little red checkmark-looking lines are my new activation function.

On the left side we supplied some input numbers. These feed into customized neurons that, after multiplying each input by their own custom numbers, produce outputs. Those outputs are the inputs to other neurons. Eventually we want to winnow this down to just a few or even one output, and as we crank our way through from left to right, we get one number for each output.
Notice one thing I’m doing here: I’m arranging these neurons visually in columns, which are usually called layers. Layers provide depth. Every neuron in a layer has the same inputs6, even if they multiply those inputs by different numbers or 0 as part of their own customization. Eventually we’re going to be working with a ton of neurons, even billions, and anything we can do to group them into chunks will make it easier for us to conceptualize the network. Layers of neurons that all share the same inputs and the same function are much easier to work with and think about. The network expands, then, by either adding more neurons to a layer, or by adding more layers.
Within a layer, the neurons are identical in structure but are still differentiated by those numerical customizations (b, a1, a2, etc.) Changing the customizations changes what output we get from a particular set of input numbers. Making one a value a large positive or negative number can make its associated input more important to that neuron; making it very small or even zero can cause that input to be ignored.
If I want to make a copy of my network, or save it to use later, there are some pieces of information I need to keep. First, the structure of the network itself: how may neurons with what functions in their circles, and how their inputs and outputs are connected. Organizing into layers makes this so much easier. Second, all the customization numbers that tweak what it does, and which are more properly called parameters. Taken together, the network structure and the parameter values are my model. You’ve probably seen these words before: models are frequently described in terms of their parameter count. Here’s where that customization trade-off comes back to bite us: Open-weight models (where the parameters are made public) downloadable through the web site Hugging Face run from under 1 billion parameters to over 500 billion; the biggest models, including major commercial models, are well over a trillion.

When a news article describes an LLM as having over a trillion parameters, then, it’s talking about numbers like those: input weights (those a values) and function parameters (just b for that little on/off switch function; others have more). You can see how that parameter count can blow up into the billions or trillions: the more neurons you have, and the more connections and inputs there are among them, you can rack up a lot of parameters fast. Parameter count, then, tells you something about the complexity of a model, and about how much computational power is needed to use them. (Numbers that customize the model itself, like the size of a layer, might be referred to as hyperparameters, to distinguish them from more neuron-level parameters.)
Actually running these things
There are some practicalities in running inputs through neural networks to calculate outputs that you may run into when reading on this topic.
No one part of a neural network is hard to compute; the math at any point is simple and fast. There’s just a lot of it, doing the same calculations over and over with different numbers. One of the primary goals of anyone looking to speed up neural network calculations is looking to see what math can be done in parallel, and what needs to wait for earlier results. Here is where that layer architecture really shines: every neuron in that layer uses the same inputs and the same mathematical equations, and you can do all of them at the same time without waiting on the results from any other neuron in the layer. As it turns out, this is exactly the kind of thing that microchips designed for computer graphics do well.
The models themselves are unwieldy without special processors. The kind of computer you’re reading this on might have a powerful processor and expensive RAM, but at the time of writing this, I doubt it can hold an entire model with more than a few billion parameters. Data in a microchip’s on-board memory (“cache”) are the easiest and fastest to work with, but that’s tiny. Parameters stored in RAM are much slower to load into cache and use than any mathematical operation. Parameters that need to be loaded from an SSD can be tens of thousands of times slower.7 There are tricks to speed things up, but the act of just moving numbers around is far more of a bottleneck than the math itself. When you see fights about advanced AI chips or GPUs, often what makes them advanced isn’t that they do any individual bit of math faster, so much as that they can do more math at a time, usually because they’re designed to store and access more model parameters more quickly.
There are options for taking a too-big model and shrinking it. It’s rare that you’ll know enough about your model to be able to hack bits of its structure off and still be able to predict how it will perform, though. Instead, you’ll see references to a common trick called quantization. Those parameter values are often precise: their numeric values are recorded to several significant figures. But as when working with , you can chop off extra digits and work with 3.1 or 3 instead of 3.1415926… and just accept some inaccuracy. That reduces the amount of disk and memory space the model takes up, and lets you move more parameters around, faster.
No matter how you divide up the work and cut back on details, though, this is a ton of math! And in fact, it’s generally more math-y even than I’ve depicted it: the calculations I’ve described lend themselves extremely well to a branch of mathematics called linear algebra. Some of you probably took linear algebra in high school or college, with exercises including adding and multiplying vectors, matrices, and tensors. I don’t want to get into the weeds here, except to point out that it is so convenient to treat neural networks as linear algebra that there are important structures (which we’ll talk about later) that don’t map back to neurons at all.
However they’re thought of, though, whether neurons or matrices, we’re still stuck with trillions of as, bs, cs, and other parameters. So we need to figure out what numbers to fill in… but that’s a whole other post. The next post, in fact!
How might this show up in fiction?
Let’s take a step back and figure out how what we learned might figure into a story.
If you’re writing at the level of characters talking about individual neurons, it should be clear now that they’re at the very least extremely in-the-weeds: after all, a network might have hundreds of billions them. There’s a strong pressure to not have to think about neurons at all. It will be more natural to talk about the network in terms of its structures like layers, or in linear algebra terms like “matrices” and “tensors,” rather than “neurons” or “perceptrons.” Undesired behavior is more likely to be addressed either in the high-level structure of the network or in the training (which we’ll get into next time), and there are far too many parameters to adjust any of them by hand.
Hyperparameters are a different story, though: your characters can and likely would tinker with high-level hyperparameters like the size of individual layers, the number of layers, or parameters related to concepts we’ll talk about later.
Where is there room to describe your characters doing something ground-breaking at this stage? Personally, I’d look at coarse network structure. We only got into layers this time, but there are a lot of specialized patterns of neurons that enable a network to work with different kinds of data. Broadly speaking what we just learned was a simple fully-connected feed-forward neural network: all the inputs start on one side, every neuron in a layer has the same inputs, and computation marches in a single direction with no loops until an output is calculated. That allows for major speed-up tricks when doing a lot of similar math at once, but it’s not the only game in town. Recurrent or Convolutional neural networks use different patterns of neuron connections to deal with things like images or streaming data (a network that transcribes live speech might use such a structure, for example). Describing your characters as having designed a new architecture (the whole arrangement of the network), structure (the selection and arrangement of parts of the network), or mechanism (the function performed by a part of the network) would make sense as an advance.
If you want depict your characters making major strides at the level of neural network design, I can think of two recent examples you might pattern that on.
The first example is the invention of the structure called a Transformer (which I’ll dig into in a later post). The Transformer is frequently credited with enabling modern large language models like ChatGPT. The Transformer was originally described in the 2017 paper “Attention is All You Need”, referring to an existing neural network mechanism called “attention”. The key insight of this paper was right there in the name: attention had up until that point been used in combination with more complicated looping structures like recurrence; this paper showed that it could be used alone to great effect. What was that effect? Speed. The Transformer paper used and tweaked existing structures to allow far more math to be done in parallel, allowing designers to make more efficient use of resources like computer time or training data. Note also that this paper focused on machine translation; it was further adapted for structures like GPT (Generative Pretrained Transformer).
The second example is the 2014 invention of Generative Adversarial Networks. This was a novel approach at the high level, with the key insight that two neural networks could be used and trained together. One network generated something like a picture, while an opposing network attempted to distinguish machine-generated pictures from real ones. Essentially, it created both an art forger and a forgery detector at the same time: as one got better, so would the other. In this example, existing whole architectures were combined in the context of a novel analogy.
As a social matter, it’s worth noting the path to publication for both of these advances: Preprints of the papers were made available on the site arxiv.org to solicit feedback, and they were each subsequently published in the proceedings of the annual NIPS conference (Neural Information Processing Systems, an unfortunate acronym that was changed to NeurIPS in 2018). It’s rarely clear at the time what will prove to be a major advance, and often other researchers are already working with similar technologies: The paper “Attention is All You Need” was one of several papers with “Attention” in the title that year, for example, and was presented as one of dozens of posters rather than a main stage talk.8
Aside from specific advances in structure, science fiction writers should pay attention to how the sizes of these networks have grown. Talking about a “trillion parameter model” isn’t going to sound futuristic (unless it’s running on someone’s phone or something). I should note that quantum computers are not a replacement for this parallel math, but it’s entirely possible that new microchip designs could make neural networks faster and more efficient to compute.
A fictional neural network need not be anywhere near as big as they are today, though! For comparison, you may have seen recent articles on scientists working with the Drosophila connectome: a complete mapping of the connections among neuron cells in a fruit fly. These measure in the “mere” millions of connections for hundreds of thousands of neurons, and support the Virtual Fly Brain project that simulates the working of a fruit fly’s whole neural anatomy. Broadly speaking, the complexity of biological behavior is achieved through specialized structures: Millions of years of neural structure evolution beats billions of simple perceptrons any day of the week. So again, if you want to describe characters making major advances at the level of the network itself, having them invent a clever or more efficient new structure that either makes much better use of expensive chips or obviates them entirely is the way I’d go (and indeed, real life research teams without access to the best chips are pursuing exactly that strategy).
If you’re describing an alternative version of neural networks in a fantasy world or steampunk setting without computers or the equivalent, you’re probably talking a physical embodiment. You’ll need to think through what the analogues of neurons and their parts might be. It would either be incredibly tiny or take up a great deal of space. You’ve got an in and an out, where there’s lots of ins and some way of deciding what the one out should be for a particular pattern of ins. Maybe a neuron is replaced by a magic jewel inscribed with an inlay that links the jewel’s facets in certain ways, with one facet reserved for the result. Gold wire might then provide interconnection, and the result would be very pretty and obscenely expensive. Or you can go back to biology: specially-bred fungi might be an interesting way to approach the problem, in much the same way that people have experimented with using slime molds to solve problems like mazes9.
Characters constructing a physical neural network are going to want to standardize as much as they can, especially as the networks get large. Layers (and other structures) are used like boilerplate so that large chunks of networks can be laid down at a time with predictable characteristics. You might have a system with magical ink, for example, so that the drawing is the network. If so, your characters might seriously consider the use of premade stamps or print blocks to deal with just the sheer number of the things they’ll need to draw. A carved woodcut rolled in magical ink might be the equivalent of a layer.
Neural networks are an artful combination of clever structure and brute force building on each other, but in tension too. Over and over, you’ll see the pattern where a simple but clever concept is introduced and whittled down to the simplest it can be… but then it only really blossoms when used at scale. A simple neuron with the simplest possible math is copied so many millions of times that if they weren’t simple we couldn’t work with them. Elegant structures get repeated so many times in sequence and in parallel that if they weren’t so elegant they’d just snarl things up. But then the sheer scale gets so unwieldy that new and clever efficiencies are needed. And fueling that scale, notoriously, is an ocean of data… but that’s for next time.
Further Reading
If you’ve got some tolerance for math, especially linear algebra, there are a lot of good resources for learning more. In general, Wikipedia tends to be very good on computer science topics, and I referred to it repeatedly on too many topics to individually list, but there are two sources I particularly like to refer to:
- Grant Sanderson’s 3Blue1Brown videos
- Prof. Tom Yeh’s AI by Hand Substack
- Andrej Karpathy’s YouTube channel, particularly the Zero to Hero series
- Just ask Dwarf Fortress players. ↩︎
- Alan Turing did some early neural network work in the 1940s, including a remarkable 1948 paper titled “Intelligent Machinery” that anticipates a great deal of how this technology would evolve, including a variant on the Turing test involving chess Even earlier is the influential paper by McCulloch and Pitts, “A Logical Calculus of the Ideas Immanent in Nervous Activity” (1943) whose title is an excellent indicator of just how miserable it is to attempt to read. ↩︎
- Anyway, my attempts to draw neurons all just look like fried eggs. ↩︎
- Specifically, it’s a step function and while it’s easy to understand, it’s rarely used because that abrupt jump from 0 to 1 causes trouble with some of the math later. ↩︎
- You’ll see this perfectly friendly checkmark-looking function saddled with the name Rectified Linear Unit (ReLU), as though anybody deserves that. ↩︎
- For now. I’m describing a “fully-connected network” here, and practitioners working with vision or audio systems especially are mad at me right now. We’ll talk about convolution later. Maybe. If I feel like it. ↩︎
- It could be worse: I used to lecture in the days of mechanical hard drives, where you’re talking a factor of millions. At each stage data is slower to access, but you’ve got more space. I used to use the example of cooking and needing a potato. Having data in first level cache was like having a potato on the counter. Second level cache, like a few in the pantry. RAM, like having a sack of potatoes in the far corner of the basement. SSD, like driving across town to Costco and coming back with a carful of spuds. Spinning disk, as I described it 20 years ago, was like driving to Maine, planting a field’s worth, waiting all summer, and driving them back in a semi. ↩︎
- One attendee describes the experience of attending NeurIPS the following year, as the conference has gotten increasingly flush with cash. I can only imagine it has gotten even more nuts in the past few years. ↩︎
- Slime mold computation is fascinating, though a bit more complex than popular science reporting lets on. The podcast Daniel and Kelly’s Extraordinary Universe had a great discussion on the topic. ↩︎
One thought on “No-Hype AI Part 1: Neural Networks”