The ZiptieAI mission is to provide

  • 1 Basic AI concepts (this page)
  • 2 AI demos / concepts (top level pages “QS”, “Concepts”)
  • 3 AI deep dive (code) (top level pages “2 NNs”, “2b Models”, “3 Agents”, “3b Projects”)
  • 4 A window to the AI future


1 Basic AI concepts

The engineering genius behind AI is amazing. But building successful AI applications requires a basic understanding of what AI really is.

  • 1.1 AI = deterministic algorithms running on digital HW
  • 1.2 LLM agent + transformer = simulated intelligence
  • 1.3 The core of AI: NN classification (matrix math based pattern matching)
  • 1.4 Extensions of the simple NN (CNNs, TFs)
  • 1.5 The TF algorithm (QKV context computation from 2020) is still the basis of LLM AI
  • 1.6 AI is an incredible revolutionary engineering marvel.. for the right applications
  • 1.7 Falling for AI hype can cost you… dearly
  • 1.8 AI’s place in our world (not our place in AI’s world)


1.1 AI = deterministic algorithms running on digital HW

The following is an example of the python code that defines the structure and training algorithm of a very simple NN. Such a NN runs on clocked binary circuits and will always output the EXACT same result for the same input. The inputs and outputs are ONLY FP (floating point) numbers. NNs are pure number crunchers.

desc

The AI simulation of intelligence started to seem intelligent only recently after the computational hardware reached the performance level required to (1) generate responses at least as fast as a human could read them and (2) with a level of accuracy that (at least initially) convinced users that AI had some level of genuine intelligence. But AI has no intelligence. AI algorithms and the circuitry they run on have little similarity to human brain neurons. You could run the most sophisticated LLMs on GPUs based on electro-mechanical relays. It might require its power plant and take years to answer a prompt, but it is theoretically possible.

Electro-mechanical relay
drones


1.2 LLM agent + transformer = simulated intelligence

LLM AI is based on 2 very distinct computational components.

  • Transformer (TF) generates response tokens based on the input tokens. The actual TF algorithm only computes FP numbers. The TF computational process is a straight shot (not procedural). The TF computes a classification of the entire input. This classification is used to select the next token. That new token is added to the input. The TF is reset, and the process for the next token starts. This process continues until the TF stops or the iAgent comands a stop.
  • Internal agent (iAgent) sends and receives tokens to/from the TF. The iAgent is the core control loop, the typical procedural program (usually confusing referred to as the deterministic program; the problem is the GPU is also 100% deterministic). The iAgent has an API that allows the external world (a human or an “external Agent”) to use the model.

Note: TF algorithms are referred to as “neural” networks because the diagrams for NN matrix math look like diagrams that could be considered similar to those for biological neural networks.

drones

The LLM agent and transformer are the inseparable duo that simulates intelligence
drones


1.3 The core of AI: NN classification (matrix math based pattern matching)

“Training” = programming a NN (not teaching; a NN does not learn). The process involves

  • Feed FP numbers (converted input text prompt and answer) to the NN.
  • Compare the input against the shifted (one token) output.
  • Adjust the internal parameters of the NN every so slightly so that the error from the expected output is reduced (without messing up significantly other already trained inputs).
  • Repeat this a massive number of times. This “training” can take weeks.
  • Hope for a stable result. The training process is not predictable.

Inference is when the TF is used to recognize the pattern of the some never before encountered input (not matching exactly anything the TF was trained on). This is the “magic” of AI. The TF computes the probabilities of all possible outputs (usually 50K vocab tokens) and the best token is selected (unless “temperature” is used; this is a gimmick where the TF selects randomly one of the more probable tokens to give the illusion that the TF is non-deterministic).

drones


1.4 Extensions of the simple NN (CNNs, TFs)

Detecting simple patterns (classification) worked fine with a simple NN. But for images and text, some extra “pre-processing” is required for classification.

For text convolution is added (thus convoluted NN). Convolution is matrix math performed before the core classification NN (the “dense layers”). This is required because of the nature of recognizing pixelated input (pixels are convoluted with neighboring related pixels).

For text a transformers is added. This basically computes the real meaning of the original tokens based on the “neighboring” by meaning tokens. There is also the core NN in the form of an “FFN” (no need to translate, the name is meaningless) for each token. The tokens adjust each other and go through the FFN for many layers, and the classification “percolates” into the FP numbers (12288 for each token in GPT-3) of the last token. The new token is actually based on a CLASSIFICATION of the entire input.

drones


1.5 The TF algorithm (QKV context computation from 2020) is still the basis of LLM AI

The TF QKV context computation algorithm modifies the token “hidden layers” (12288 FP numbers that are called “hidden” because you can not determine what the computations do by analyzing the programmed parameters) based on other tokens (thus computing context adjustments). 2.3.6.1b D5 tiny TF algorithm details (draft, WIP) explains in detail the simplest demo (its not simple) of the LLM TF QKV (context) mechanism.

drones

The core of AI is not rapidly evolving. Thats one reason why AI continues to focus on ramping up brute-force computation (“scaling”). The pic below is from a video I was watching on 26.0629. That one line “key-value (KV) caches need to be maintained” explains (part of) the reason why AI needs so much memory. Google “what is a kv cache” for details.

QKV is still the core of LLM AI (video)
drones


1.6 AI is an incredible revolutionary engineering marvel.. for the right applications

Palantir in the past few years has become synonomous with cutting edge real world AI applications. But Palantir only recently adopted AI. 25 years ago Palantir’s initial projects were for military applications without AI. These non-AI apps were designed as helpful assistants for decision makers, not as as a replacement for mankind. AI later became the ultimate helpful assistant for Palantir’s missions. AI had limitations, but the benefits of AI far outweighed the negatives when AI was applied properly.

A very successful real-word application of AI
drones


1.7 Falling for AI hype can cost you… dearly

“No more programmers”, “no more workers”, “self-driving cars will be ready next year”, “we must pause AI development because its not safe”, and “AI already has emotions” (that last statement was from a winner of both the Nobel and Turing prizes). If you yourself fall for such hype, it can cost you dearly.

An unsuccessful mission for AI
drones


1.8 AI’s place in our world (not our place in AI’s world)

Its no accident that Palantir talks straight about many aspects of AI. Palantir’s business does not demand the myth of AI intelligence. Palantir says that AI will not replace people, it will empower them and that “engineers wont go away, because their AI-enhanced expertise will be required even more in the age of AI”. If AI was truly intelligent then AI integration would just involve connecting AI and letting it rip. But successful AI integration into any system requires extensive technical expertise. In the diagram below, the small green box (far left) represents the core legacy enterprise SW. The core algorithms and workflows developed over decades for such systems are not going to be replaced by AI. AI is going to assist, and in such a way that AI’s unavoidable errors will not cause significant problems.

AI is an add-on, a helpful assistant, never in the driver’s seat
drones


2 AI demos / concepts

Note: The latest architectures are not introducing anything radically different from the core AI functionality of these simple demos. I recently saw a video where one of the author’s of the original paper “Attention is all you need” stated that no other ground-breaking architecture has appeared since the paper was pubished.


2.1 Core AI demos (QS)

You can only learn how AI works by doing code demos (or at least studying the code). Code does not lie.

A simple NN demo of the core of AI
drones

NOTE: About my use of “tiny” demos and analysis based on Alex-Net CNNs (2012) and GPT-3 (2020) throughout this site. The core of AI is not rapidly evolving. The simple demos on this site are the best demos if you want to understand the core mechanics of how AI really works. For example, page 2.3.6.1b D5 tiny TF algorithm details (draft, WIP) explains in detail the simplest demo (its not simple) of the LLM TF QKV (context) mechanism

QKV is still the core of LLM AI (video)
drones


2.2 Core AI technical concepts

This section focuses on a conceptual understanding of the technical aspects (especially the algorithm details) of the demos.

The similarities of the CNN and TF algorithms
drones


3 AI deep dive (code)

The code demos are organized into the 4 groups shown in the diagram below.

  • (2) Core NNs.
  • (2b) Models that package core NNs for reuse.
  • (3) External agents that provide an interface between models (helpful assistants) and legacy systems.
  • (3b) Real-world projects.

The ZiptieAI deep dive takes you methodically through the entire AI stack
drones


4 A window to the AI future

AI has a big future even after the pre-IPO hype is over. Those who understand how to integrate AI into their own workflows will benefit the most. ZiptieAI has a mission to help myself (and others) stay ahead of the AI curve. In the near future, AI integration skills will be required in all business segments (just like with the PC 40 years ago). This work will require a massive number of tech workers who, empowered by AI tools, will integrate AI as a helpful assistant into all areas of life.

The helpful assistant of the future
desc

The future man-machine interface (NL)
desc


26.0703 (v1 26.0611)