Viqus Logo Viqus Logo
Home
Categories
Language Models Generative Imagery Hardware & Chips Business & Funding Ethics & Society Science & Robotics
Resources
AI Glossary Academy CLI Tool Labs
About Contact
Back to Glossary
Technical Concepts Beginner Also: Procedure, Computational Method

Algorithm

Definition

A finite, well-defined sequence of instructions or rules that takes an input, performs a series of computational steps, and produces an output — the foundational building block of all computing and AI systems.

In Depth

An algorithm is a precisely specified, finite sequence of computational steps that transforms an input into an output. Algorithms are not unique to AI — sorting a list, encrypting a password, or routing a network packet all involve algorithms. What distinguishes AI algorithms is their purpose and, often, their adaptability: machine learning algorithms are designed to learn patterns from data and update their behavior based on experience, rather than following a fixed set of hand-coded rules.

In Machine Learning, the algorithm specifies the procedure for learning from data: how to initialize the model, how to compute predictions, how to measure error (the loss function), and how to update the model's parameters to reduce that error. Gradient descent is an algorithm. Backpropagation is an algorithm. K-means clustering is an algorithm. Each defines a precise computational process that, given data, produces a trained model — which then applies a different algorithm (inference) to make predictions.

The choice of algorithm is a critical design decision in any ML project. Different algorithms make different assumptions about the data: linear regression assumes a linear relationship; decision trees assume hierarchical, rule-based structure; neural networks make fewer assumptions but require more data and compute. Algorithm selection, combined with Feature Engineering and Hyperparameter Tuning, determines the quality and efficiency of the resulting model. No single algorithm is best for all problems — the 'No Free Lunch' theorem formalizes this.

Key Takeaway

An algorithm is the recipe — the precise, step-by-step procedure that transforms inputs into outputs. In AI, algorithms learn from data, making them adaptive rather than fixed — but they are still fundamentally deterministic computational procedures.

Real-World Applications

01 Sorting and search: classic algorithms like merge sort and binary search form the efficiency backbone of every data system.
02 Machine learning training: gradient descent, k-means, and backpropagation as the algorithmic engines that train AI models from data.
03 Recommendation systems: collaborative filtering algorithms that identify similar users or items to generate personalized suggestions.
04 Encryption: cryptographic algorithms (RSA, AES) that secure communications, payments, and data storage.
05 Routing and optimization: shortest-path algorithms (Dijkstra, A*) that power maps, logistics, and network routing.

Frequently Asked Questions

What is the difference between an algorithm and a model?

An algorithm is the procedure or recipe — the set of steps used to process data. A model is the result of applying that algorithm to training data — the learned pattern or function that makes predictions. For example, gradient descent (algorithm) trains a neural network (model). The algorithm is the process; the model is the product.

What are the most important algorithms in Machine Learning?

Key algorithms include: linear/logistic regression (simple, interpretable baselines), decision trees and random forests (powerful for tabular data), gradient boosting (XGBoost, LightGBM — top performers on structured data), k-means (clustering), gradient descent and Adam (optimization), backpropagation (neural network training), and the attention mechanism (core of Transformers). Each serves a different purpose and data type.

Do I need to know algorithms to use AI?

For using AI products (ChatGPT, Claude, recommendation systems): no, you need them as much as you need to understand combustion to drive a car. For building or customizing AI systems: yes, understanding algorithms is essential for choosing the right approach, diagnosing problems, and optimizing performance. Even with automated tools (AutoML), algorithmic literacy helps you make informed decisions.