07 — My Thoughts
Why AI-first is (probably) not a good idea
When I think about the emergence of AI-first companies, I can’t help but think of all the other hyped up technologies of the past. Every decade or so, a genuinely transformative technology pops up and soon companies rush to slap it on their identity, even before figuring out what problems it can solve for them. It happened with the internet (the dot-com suffix added to just about anything), blockchain, and now with AI. The technology isn’t the problem here, it still holds ground very well, but the immediate reflex of companies to be first with it, at the cost of good judgement, is.
Lets start small
Before even going into generative AI, let me start from the very basics. My introduction to AI was from statistics. Using regression, find the price of a house when you are provided with the prices of other houses and their square footage in the same area. This problem of simple linear regression is the simplest form of AI I can think of. It forms a straight line on a graph where you plot the a point for the house you want to find the area of.
—
3 axes is all a graph can show. Add a 4th variable and we can’t draw it — but the maths works in as many dimensions as you like.
drag to rotate ↔
That orange line is the model. It fits the dots once — then any size you feed it comes back as a price. Nothing more mystical than that.
Simple, isn’t it? In this example you have two dimensions, square footage of the house and its price, therefore, forming a 2-dimensional graph. But we do know that the price, in an actual sense, would depend on many factors, like the age of the house, past ownerships, topography of the land, availability of drive-ways and a lot more. A lot of these parameters can be objectively put in numbers, and with each new parameter, we add a dimension to the graph. Now we can’t imagine anything above three dimensions, but computers can, and they work very well with them.
Functions
Now let me explain. A function in mathematics takes a set of inputs, does some calculation (another over-simplification here) and returns an output. Like the price of a house depends on square footage of the house, age of the house, number of drive-ways and many such variables.
The way we predominantly build AI now, is using Neural Networks, owing to their capability of solving complex problems. This would be an over-simplified statement, but I’d refrain from going into their workings in this article. The key idea is this: Neural networks are function approximators.
Two ways of solving a problem
In computer applications, we have, for a majority of the instances, solved problems with a deterministic method. As in, we know the rules, we know the calculations and we write very specific logics to get the output. For anyone from a coding background, defining variables, using operators, writing conditional statements and loops is, fundamentally, all that is required to write any program. Anything on top of this is just an abstraction to make our life easier, and also, by means of optimizations, make it run better on bare hardware. This is the case where we know the deterministic path. But what if we don’t.
Deterministic
You write the rules. If this, then that — and it follows them exactly. Instant, free, always right.
Probabilistic · AI
You show it examples. When no rule can be written, it learns the pattern from thousands of cases and approximates.
So which way fits? Tap a problem.
Most everyday problems already have a rule. AI earns its place only when none does — which, it turns out, is rarer than the hype suggests.
Let’s take an example of self-driving cars. We can build the software for a self-driving car by coding all the traffic rules, car physics, and road maps. But adding driving skills is a mammoth task, if it were even possible. I really don’t think coding all possibilities on a road for a self-driving car is ever possible using purely deterministic methods. But humans do drive in such conditions, so it is possible to be done. So how do we make a computer do it?
The answer is simple, if we are able to train a computer how to drive with countless examples of actual people driving and let it figure out the rest, it may be possible. That’s the idea behind self driving AI. But what is happening under the hood? How do we exactly “train” a computer? The answer we have for now, is neural networks. A neural network takes the inputs from the cameras and other sensors on a car which a human is driving, and also at the same time consuming the actions the human driver takes. Using some very clever mathematics, it starts predicting what the driver would do next while driving, and upon the action of the driver, it checks its own prediction against the action. The difference between the computer’s prediction and the actual human action is what is roughly translated into something we can make an “error”. What the neural network then does is, again by using some clever mathematics, reduce this error. Essentially what it does is make the computer behave as similar as possible to a human. While this was only about the work the neural network does, in real world we use a number of steps on top of this, like simulation, reinforcement learning and ironically, rule based learning (we’d come to this in the end)
Function Approximators
Now that we have a rough idea of a neural network, we’d come back to the actual problem, self-driving cars. When a human drives a car their actions are determined by a number of factors, current speed, the road, visibility, light, weather conditions, pedestrians and foliage around, time of day and a lot of variables that we can’t even list down. So, the action a driver takes is a function of all the variables I mentioned above. But because the variables are so many that permutations and combinations required to write a hardcoded logic for driving, is for all intents and purposes, impossible (without even considering variables we can’t even think of). For instance a logic with all variables like at 3pm, sunny weather, road wider than 15 feet, no car at a distance of 50 feet ahead, less than 4 pedestrians moving at 1m/s from the left trying to cross the road, the car should decelerate at 5m/s. Now consider the possibilities, and you’d know why it is impossible to even think about writing that program.
While it is impossible to write the program, we know that human drivers do it. They do consider a lot of things (variables) and make real time decisions. So, theoretically, there is an underlying function for driving that considers all those variables and outputs the decision that the driver takes. What neural networks do, by looking at hours and hours of driving patterns, approximate that function. Re-iterating, neural networks are just function approximators.
With only a handful of examples the best it can do is a straight-line guess. Feed it more and the same machinery bends to fit — it's approximatinga function it was never handed. That's all a neural net is, at scale.
The Crux: Why AI first is, probably, not a wise choice
While AI is helping us solve so many problems (the biggest in my opinion would be the protein folding problem) it isn’t the only way to solve problems. AI is essentially a probabilistic approach. It makes mistakes (all AI chatbots have this disclaimer for a good reason). We already have deterministic solutions for so many problems, that I believe we are undermining all the hard work that went into finding the theoretical, and mathematically proven, best ways of solving some problems.
What I’d wish would stay with all readers of this article is this:
Do not use a probabilistic method to solve a problem which has already been solved using a deterministic method.
While for all research purposes, I’d encourage trying AI to find even better ways of solving deterministic problems, but until those methods are not found, stick to the deterministic method. A simple example would be not reading a machine-readable PDF file using an AI OCR tool. The latter is more expensive (in terms of compute), will contain errors and would also consume more time; whereas a parser would do it quicker, cheaper and near perfect accuracy.
Item Qty Price Widget 12 $ 4.00 Gizmo 3 $19.50 Sprocket 40 $ 0.75
Deterministic parser
AI OCR model
Both read the same file. One already knows the answer; the other guesses at it.
What I’d suggest
In my opinion, for building a product, I’d urge people to use deterministic methods wherever possible and move to AI (or any other probabilistic method) only in places where those methods break, and in most cases the line between the two is usually clear. For the rest, I’d suggest using AI, or any other probabilistic method we have at our disposal. There is already a phrase for this:
Use AI on the edges
I.e. Use AI only when the problem does not have a deterministic solution available.
At the same time, I’d also encourage people to try to find better deterministic methods themselves using AI, which I believe is already an area of active research. For instance AlphaFold is leading to discovery of new biochemical rules already.