Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Artificial intelligence is software that learns patterns from data and uses those patterns to make predictions, classify information, generate content, or choose actions. It matters because AI systems now help filter spam, recommend videos, translate languages, detect disease, and control robots. At the center of many modern AI systems is a model, which is a mathematical function with adjustable parameters.

Training changes those parameters so the model becomes better at a task.

Understanding How AI Works

Before a computer can learn, messy real-world information must be turned into numbers. A photograph becomes a grid of pixel values. A spoken sentence becomes measurements of sound, then smaller units related to language.

The chosen measurements are called features. They determine what evidence the system can use. If an important clue is missing or measured badly, more computing power will not fix the problem.

Labels are targets supplied by people, sensors, or past records. A label can be wrong, incomplete, or influenced by human judgment. This means an AI system begins with choices made long before training starts.

During training, the model makes an initial guess for many examples. Its guesses are compared with the known answers, which produces a measure of error. The training process uses that error as feedback.

Connections inside the model receive small adjustments that should reduce future error. This cycle happens again and again, often with small groups of examples rather than the whole dataset at once. The size of each adjustment matters.

Large changes can make learning unstable. Very small changes can make training slow. Computing hardware matters because modern models may repeat this process billions of times.

A low error score on familiar examples does not prove that a system works well. A model can memorize details that are not useful outside its training data. This is called overfitting.

To check for it, developers keep some examples separate until testing. These examples should resemble the real situation where the AI will be used. Data leaks can make a test look better than it really is.

For instance, if near-identical photos appear in both training and testing, the system may recognize the photo instead of learning the object. Students should notice the difference between a pattern that predicts reliably and a coincidence that only appeared in one dataset.

AI outputs are usually estimates, not facts. A spam filter may assign a high chance that a message is unwanted. A medical support tool may flag an image for expert review.

People or organizations then choose a threshold for action. A strict threshold misses fewer important warnings but may create more false alarms. A loose threshold has the opposite tradeoff.

Bias can enter through unbalanced data, unclear labels, or the way results are used. When studying AI, pay attention to the input data, the target being predicted, the testing method, and the cost of mistakes. These details often matter more than the name of the algorithm.

Key Facts

  • A basic AI model can be written as y = f(x; theta), where x is the input, y is the output, and theta represents learned parameters.
  • Training data contains examples that teach the model, such as image pixels paired with labels like cat or dog.
  • A loss function measures error, such as mean squared error: L = (1/n) sum(yi - yhat_i)^2.
  • Gradient descent updates parameters using theta_new = theta_old - alpha grad L, where alpha is the learning rate.
  • Neural networks pass information through layers using weighted sums, activations, and connections between nodes.
  • AI performance must be tested on new data because memorizing training examples is not the same as learning a useful pattern.

Vocabulary

Artificial intelligence
Artificial intelligence is the field of building computer systems that perform tasks that normally require human-like reasoning, perception, language, or decision making.
Model
A model is a mathematical or computational system that maps inputs to outputs using learned parameters.
Training data
Training data is the collection of examples used to adjust an AI model so it performs a task more accurately.
Neural network
A neural network is a model made of connected layers of artificial neurons that transform input data into useful outputs.
Loss function
A loss function is a formula that measures how far a model's prediction is from the correct answer.

Common Mistakes to Avoid

  • Thinking AI understands like a human. Most AI systems detect statistical patterns in data, not meaning in the human sense.
  • Training and testing on the same data. This can hide overfitting because the model may memorize examples instead of learning patterns that work on new cases.
  • Using a learning rate that is too large. Large updates can overshoot the best parameters and make the loss unstable or worse.
  • Assuming more data always fixes bias. If the data is incomplete, unfair, or incorrectly labeled, a larger dataset can still teach the model the wrong patterns.

Practice Questions

  1. 1 A model predicts 8, 10, and 13 for correct values 9, 12, and 12. Calculate the mean squared error using L = (1/n) sum(yi - yhat_i)^2.
  2. 2 A parameter starts at theta = 4.0. The gradient of the loss is 1.5 and the learning rate is alpha = 0.2. Use theta_new = theta_old - alpha grad L to find the updated parameter.
  3. 3 A face recognition system works very well on its training photos but poorly on photos from new cameras and lighting conditions. Explain what likely happened and name one way to reduce the problem.