Skip to content
elevatedevco

Deep Learning

Neural Networks Explained

Learn Neural Networks Explained: 50 practice questions and answers with an interactive quiz — from the offline AI Learning app.

Intermediate50 questions26 quiz questions

Questions & Answers

Tap a question to reveal its answer. Written for self-study and interview preparation.

What is a neural network?

A neural network is a type of AI system loosely inspired by the human brain. It's made of layers of connected 'nodes' (artificial neurons) that process numbers. Data enters the first layer, gets transformed through hidden layers, and produces an output in the final layer. Neural networks learn by adjusting the strength of connections between neurons based on examples, eventually becoming very good at tasks like recognizing images or translating text.

What is an 'artificial neuron'?

An artificial neuron is the basic unit of a neural network, loosely modeled on a brain neuron. It receives numbers as inputs, multiplies each by a weight, adds them all up plus a bias value, then passes the result through an activation function. A real brain neuron fires an electrical signal when stimulated enough; an artificial neuron 'fires' (outputs a significant value) when its weighted input sum exceeds a threshold.

What are 'layers' in a neural network?

A neural network organizes its neurons into layers. The input layer receives the raw data. Hidden layers transform that data through learned weights (the 'magic' of the network). The output layer produces the final prediction. 'Deep' networks have many hidden layers — that's where 'deep learning' gets its name. Each layer learns to detect increasingly abstract features: early layers detect edges, later layers detect shapes, then objects.

What is a 'weight' in a neural network?

A weight is a number that controls how strongly one neuron influences the next. High weight means 'this connection matters a lot.' Low weight (near zero) means 'ignore this.' Negative weights mean 'this input predicts the opposite.' During training, the network adjusts millions of weights to minimize its prediction errors. After training, those weights encode everything the network has learned — they're the 'memory' of the neural network.

What is 'bias' in a neural network (not data bias)?

In neural networks, a bias is an extra number added to a neuron's input sum before the activation function. It allows the neuron to shift its activation threshold — like adjusting the starting position of a dial. Without bias, all neurons would be forced to output zero when all inputs are zero, severely limiting what the network can learn. Bias makes the network more flexible by letting neurons activate even when no strong input signal arrives.

What is an 'activation function'?

An activation function decides whether a neuron should 'fire' and how strongly. Without activation functions, neural networks would just do linear math — no matter how many layers, the output would always be a simple linear combination of inputs. Activation functions like ReLU, sigmoid, and tanh add nonlinearity, allowing networks to learn complex, curved patterns. They're the secret ingredient that makes deep learning powerful for real-world problems.

What is the 'ReLU' activation function?

ReLU (Rectified Linear Unit) is the most popular activation function in modern neural networks. Its rule is simple: if the input is positive, output it unchanged; if negative, output zero. ReLU(x) = max(0, x). It's fast to compute, helps with the vanishing gradient problem, and lets networks learn complex patterns efficiently. Most hidden layers in deep networks use ReLU (or a variant like Leaky ReLU or GELU) as their activation function.

What is 'forward propagation' in a neural network?

Forward propagation is when data flows from left to right through a neural network — from input layer to output. Each neuron receives inputs, multiplies by its weights, adds its bias, applies the activation function, and passes the result to the next layer. Like a telephone game where each person passes a transformed message to the next. At the end, the final layer produces the network's prediction for the current example.

What is 'backpropagation'?

Backpropagation (backprop) is the algorithm that trains neural networks. After forward propagation produces a prediction, the network calculates how wrong it was (the loss). Backprop then works backwards through the network, using calculus (the chain rule) to figure out how much each weight contributed to that error. It nudges each weight in the direction that reduces the error. Repeat millions of times, and the network gradually gets very good at its task.

What is 'deep learning'?

Deep learning is machine learning using neural networks with many hidden layers (the 'deep' part). Extra layers allow the network to learn very complex, abstract representations. A shallow network (few layers) can detect simple patterns; a deep network (dozens to hundreds of layers) can recognize faces, understand language, or beat world champions at chess. The rise of GPUs and large datasets made deep learning practical — before that, deep networks took too long to train.

What is a 'CNN' (Convolutional Neural Network)?

A CNN is a neural network specialized for processing images. Instead of connecting every neuron to every pixel (which would require billions of connections), CNNs use 'filters' that slide across the image looking for patterns — edges, textures, shapes. Each filter detects one type of feature. Stacking filters in layers lets the CNN detect increasingly complex things: lines → edges → shapes → objects → scenes. CNNs power face recognition, self-driving cameras, and medical imaging.

What is a 'RNN' (Recurrent Neural Network)?

An RNN is a neural network designed for sequential data — text, speech, time series — where the order matters. Unlike normal networks, RNNs have a 'memory' that passes information from one step to the next. When reading a sentence word by word, the RNN remembers what it read earlier to understand the current word in context. They were widely used for language tasks before transformers largely replaced them for most applications.

What is 'LSTM' and how does it improve on basic RNNs?

LSTM (Long Short-Term Memory) is an improved RNN design that solves the 'vanishing gradient' problem — where basic RNNs forget information from early in a long sequence because gradients shrink as they travel backward. LSTMs have special 'gates' that control what to remember, what to forget, and what to output at each step, like a memory with a selective erase feature. They were state-of-the-art for language tasks until transformers took over.

What is the 'vanishing gradient' problem?

As backpropagation works backward through many layers, gradients (the error signals used to adjust weights) get multiplied together repeatedly. If those numbers are smaller than 1, gradients shrink exponentially as they travel backward — by the time they reach the early layers, they're nearly zero and the weights stop updating. This means early layers learn very slowly or not at all. ReLU activation, batch normalization, and residual connections (skip connections) all help combat vanishing gradients.

What is 'batch normalization'?

Batch normalization is a technique that normalizes the inputs to each layer within a mini-batch of training examples — keeping the values in a healthy range throughout the network. Without it, as data passes through many layers, the distribution of values can shift wildly (called 'covariate shift'), making training unstable and slow. Batch norm drastically speeds up training, allows higher learning rates, and acts as a mild regularizer, reducing overfitting.

What is 'dropout' in neural networks?

Dropout is a regularization technique where, during training, a random fraction of neurons are 'dropped' (temporarily set to zero) each pass. This prevents neurons from co-adapting too closely — each neuron must learn to work independently, not rely on specific other neurons. The result is a more robust network that generalizes better to new data. At test time, all neurons are active. Dropout is one of the simplest and most effective tools for fighting overfitting in deep networks.

What is a 'residual network' (ResNet)?

ResNet, introduced by Microsoft Research in 2015, added 'skip connections' that jump over one or more layers. Instead of just learning the output of a layer, each block learns the 'residual' — the difference between input and desired output. This made it possible to train very deep networks (152 layers!) without vanishing gradients, because error signals can travel directly through the skip connections. ResNets won the ImageNet competition and are still widely used today.

What is 'transfer learning' in neural networks?

Transfer learning takes a neural network already trained on a large task and fine-tunes it for a new, related task instead of training from scratch. A CNN trained on millions of general images has learned to detect edges, textures, and shapes — features useful for almost any vision task. You add new final layers for your specific task and train only those, using the pre-trained features as a starting point. This saves enormous time and data compared to starting from zero.

What does 'epoch' mean in neural network training?

One epoch is one complete pass through the entire training dataset during training. If you have 10,000 training examples and train for 20 epochs, the model has seen each example 20 times. More epochs can improve learning, but too many cause overfitting. Training typically involves monitoring performance on a validation set after each epoch and stopping when validation performance starts to worsen — a technique called 'early stopping.'

What is a 'mini-batch' in neural network training?

Instead of updating weights after every single example (too slow) or after seeing the entire dataset (too memory-intensive), mini-batch training updates weights after processing a small group of examples — typically 32, 64, or 128 examples at a time. This is the standard approach: it's faster than waiting for the full dataset, more stable than single-example updates, and GPUs are very efficient at processing batches in parallel. 'Batch size' is a key hyperparameter to tune.

What is an 'embedding layer' in a neural network?

An embedding layer converts categorical inputs (like words or product IDs) into dense vectors of numbers that the rest of the network can process. Instead of representing 'cat' as word number 450 in a vocabulary, an embedding layer maps it to a 300-dimensional vector that captures its meaning and relationships. Embeddings are learned during training — similar concepts end up with similar vectors. Word2Vec and GloVe are famous pre-trained word embedding systems.

What is a 'GAN' and how does it use two neural networks?

A GAN (Generative Adversarial Network) uses two neural networks in competition. The generator creates fake images trying to fool the discriminator. The discriminator tries to tell real images from fakes. They're trained together: the generator gets better at fooling, the discriminator gets better at catching. Over thousands of training rounds, the generator can produce photorealistic images of things that don't exist — faces, landscapes, artworks — that even humans can't distinguish from real photos.

What is 'overfitting' in a neural network?

Overfitting is when a neural network learns the training data too perfectly — including all its noise and quirks — instead of the true underlying pattern. A memorized network scores 99% on training data but fails on new data. Signs of overfitting: training accuracy is much higher than validation accuracy. Fixes include: more training data, dropout, regularization, reducing network size, or early stopping. It's one of the most common problems in deep learning practice.

What is the 'transformer' architecture in neural networks?

The transformer, introduced in 2017 in the famous paper 'Attention Is All You Need,' uses self-attention to process all words in a sequence simultaneously rather than one at a time. This parallel processing makes it much faster to train than RNNs and better at capturing long-range relationships in text. The transformer became the foundation for GPT, BERT, Claude, Gemini, and virtually every major language and vision AI model of the current decade.

What is 'attention' in the context of neural networks?

Attention is a mechanism that lets a neural network focus on the most relevant parts of the input when generating each output. In a translation network, when translating the English word 'bank,' attention looks across the whole sentence to find context clues ('river' → financial institution, 'money' → financial bank). Self-attention in transformers lets every word attend to every other word simultaneously, capturing complex relationships throughout the entire sequence.

What is 'gradient descent' and how does it train a neural network?

Gradient descent is the optimization algorithm that trains neural networks. After each forward pass, it calculates the error (loss). Then it computes gradients — how much each weight contributed to the error — using backpropagation. It then adjusts every weight slightly in the direction that reduces loss. Repeat this process millions of times (once per mini-batch, for many epochs) and the network gradually learns the correct weights to perform its task well.

What is 'pooling' in convolutional neural networks?

Pooling reduces the spatial size of feature maps after convolutional layers — shrinking the data while keeping the most important information. Max pooling takes the largest value in each small region; average pooling takes the average. This reduces computation, provides some translation invariance (the network recognizes a cat whether it's in the top-left or center of the image), and helps prevent overfitting by reducing the number of parameters.

How does a neural network learn to recognize a cat?

You show the network thousands of labeled cat and non-cat images. Initially, its random weights produce random outputs. After each wrong prediction, backpropagation adjusts the weights slightly. Over many epochs, early layers learn to detect edges and textures. Middle layers combine these into shapes like ears and eyes. Final layers combine shapes into 'cat.' After millions of examples, the weights have learned exactly what visual patterns distinguish cats from everything else.

What is a 'hyperparameter' in neural network design?

Hyperparameters are settings you choose before training begins — they're not learned by the network itself. Examples include: number of layers, number of neurons per layer, learning rate, batch size, and dropout rate. Choosing good hyperparameters is crucial; the same architecture with a learning rate 10x too large might completely fail to train. Hyperparameter tuning often involves systematic search — trying many combinations to find what works best for a given task.

What is 'neural architecture search' (NAS)?

Neural Architecture Search is using AI to automatically design the best neural network architecture for a task, instead of engineers doing it by hand. You specify the building blocks (types of layers, connections) and a search algorithm tries many combinations, evaluating performance and zooming in on the best designs. NAS discovered architectures (like EfficientNet) that outperform human-designed networks. It's AI designing AI — a form of AutoML (automated machine learning).

What is 'parameter count' and why does it matter?

Parameter count is the total number of weights and biases in a neural network. A simple network might have thousands; a large language model has hundreds of billions. More parameters mean more capacity to learn complex patterns — but also more computing power to train and run, and higher risk of overfitting with limited data. Parameter count is often used as a rough proxy for model power, though training data quality and technique matter just as much.

What is 'neural network pruning'?

Pruning removes neurons or connections from a trained neural network that contribute little to its performance. Like a tree surgeon removing dead branches, pruning makes the network smaller and faster without much loss in accuracy. A pruned model needs less memory and runs faster on phones and edge devices. Research shows that many weights in large networks are redundant — the 'lottery ticket hypothesis' suggests small subnetworks within large trained networks can perform equally well.

What is the 'exploding gradient' problem?

Exploding gradients are the opposite of vanishing gradients. Instead of shrinking, gradients grow exponentially as they travel backward through many layers. This causes weight updates to become enormous, making training completely unstable — loss values become 'NaN' (not a number). Solutions include gradient clipping (setting a maximum allowed gradient magnitude) and careful weight initialization. RNNs are especially prone to both exploding and vanishing gradient problems.

What is a 'loss curve' and what does it tell you about training?

A loss curve is a graph that shows how the model's loss (error) changes over training epochs. A healthy loss curve: training loss gradually decreases and validation loss closely follows. If training loss goes down but validation loss goes up, the model is overfitting — time to add regularization or get more data. If neither improves, the model may be underfitting — try a larger network or more epochs. Reading loss curves is a core skill for debugging neural network training.

What is 'weight initialization' and why does it matter?

Weight initialization is how you set the starting values of a neural network's weights before training begins. If all weights start at zero, every neuron computes the same thing — they never differentiate. If weights start too large, gradients explode; too small, they vanish. Smart initialization methods like Xavier/Glorot and He initialization set weights from specific distributions calibrated to each layer's size, giving training a healthy head start and speeding convergence.

How does a neural network differ from traditional rule-based programming?

In traditional programming, a human programmer writes explicit rules: 'IF input contains word X AND amount > Y THEN flag as fraud.' Neural networks don't need explicit rules — instead, they learn the rules themselves from examples. You show thousands of fraud and non-fraud cases; the network discovers which patterns matter on its own. This makes neural networks powerful for problems where the rules are too complex or unknown for humans to write explicitly, like recognizing faces or translating languages.

What is a 'fully connected layer' (dense layer)?

A fully connected (dense) layer is one where every neuron in the layer connects to every neuron in the previous layer. It's the simplest type of layer — a complete web of connections. Dense layers are used at the end of CNNs to combine all the detected features into a final decision. The downside is they're expensive: a 1000-neuron layer after a 1000-neuron layer has 1,000,000 connections to learn. Convolutional layers avoid this by sharing weights across positions.

What is the history of neural networks — when were they invented?

Neural networks were conceptualized in 1943 by McCulloch and Pitts, inspired by brain biology. Frank Rosenblatt's 1958 Perceptron was the first trainable neural network. Interest faded in the 1970s–80s ('AI winters') after overhyped promises failed. Backpropagation revived the field in the 1980s. Deep learning exploded in 2012 when AlexNet (a deep CNN) dramatically outperformed all competitors in the ImageNet image recognition competition, launching the modern AI era.

What is 'AlexNet' and why was it historically important?

AlexNet was a deep convolutional neural network created by Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton in 2012. It won the ImageNet image recognition competition by a stunning margin — 10 percentage points better than the next best. It proved that deep neural networks trained on GPUs with large datasets dramatically outperformed every other method. This victory is widely considered the moment that launched the modern deep learning revolution and transformed the entire field of AI.

What is a 'generative model' in neural networks?

A generative model learns the underlying distribution of the training data and can create new, realistic examples from it. Unlike discriminative models (which just classify), generative models 'imagine' new data. GANs, VAEs, and diffusion models are all generative models. They've learned to generate photorealistic faces, compose music, write text, and design molecules for drug discovery. Generative neural networks are the foundation of the generative AI revolution.

What role do GPUs play in neural network training?

GPUs (Graphics Processing Units) are chips originally designed for rendering video game graphics. By lucky coincidence, graphics requires the same kind of massive parallel matrix math that neural network training needs. A modern GPU like NVIDIA's H100 can perform thousands of operations simultaneously, making it 10–100x faster than a CPU for training neural networks. Without GPUs, training the large deep learning models of today would take years instead of days or weeks.

What is 'batch size' and how does it affect training?

Batch size is the number of training examples processed before updating the model's weights. Small batches (8–32): noisier gradient estimates, but the noise can help escape poor local minima and generalize better. Large batches (1024+): more accurate gradient estimates and faster wall-clock time on modern GPUs, but require careful learning rate tuning. The standard rule of thumb is: if you increase batch size by 4x, scale learning rate by 2x (square root scaling).

What is 'knowledge distillation' for neural networks?

Knowledge distillation trains a smaller 'student' network to mimic a larger 'teacher' network. Instead of training the student on hard labels (cat = 1, dog = 0), it trains on the teacher's soft probability outputs (cat = 0.85, dog = 0.10, rabbit = 0.05). These soft targets contain more information — the teacher's 'second guesses' carry knowledge about similarity between classes. The student learns to be both compact and nearly as smart as the teacher.

What is 'weight tying' in neural network language models?

Weight tying is a technique where the input embedding matrix and the output projection matrix share the same weights in a language model. Since both matrices map between the vocabulary and the hidden state space, using the same weights works surprisingly well — it reduces model size significantly without hurting performance. Weight tying was shown to be effective in GPT and many transformer language models, cutting the parameter count by hundreds of millions.

What is the 'universal approximation theorem'?

The universal approximation theorem states that a neural network with just one hidden layer (given enough neurons) can approximate virtually any continuous mathematical function to any desired accuracy. This is why neural networks are so powerful — in theory, they can learn any pattern. In practice, very wide single-layer networks are hard to train; deep networks learn the same functions more efficiently with far fewer neurons by building up representations layer by layer.

What is 'data parallelism' in deep learning training?

Data parallelism splits large training batches across multiple GPUs, with each GPU running a copy of the entire model on its portion of the data. After each forward and backward pass, the GPUs synchronize their gradients (average them) and update all copies identically. This lets you effectively use much larger batch sizes and train faster by exploiting many GPUs simultaneously. Most large model training uses data parallelism combined with model parallelism.

What is an 'autoencoder' neural network?

An autoencoder is trained to compress its input into a smaller representation (encoding), then reconstruct the original from that compressed form (decoding). It's like compressing a photo to a small file, then decompressing — the bottleneck forces the model to learn only the most essential information. Autoencoders are used for anomaly detection (abnormal inputs reconstruct poorly), data compression, noise removal, and as building blocks for generative models like VAEs.

What is 'neural scaling' and why does it matter?

Neural scaling refers to the consistent, predictable improvements in model performance as you increase model size, training data, and compute. Researchers discovered these improvements follow power laws — double the compute and you get a reliable, consistent performance gain. This finding drove the strategy of building ever-larger models. Understanding scaling laws helps researchers predict performance before spending millions on training, and helps organizations decide where to invest compute resources most efficiently.

What is 'backpropagation through time' (BPTT) in RNNs?

Backpropagation through time is how RNNs are trained. Since an RNN processes sequences step by step, training requires 'unrolling' the network across all time steps and then applying backpropagation through this unrolled version. For a 100-step sequence, the network is conceptually 100 layers deep during backprop. This makes training long sequences very expensive and amplifies vanishing/exploding gradient problems — one major reason transformers largely replaced RNNs for long-sequence tasks.

What is 'neural network interpretability'?

Interpretability research tries to understand what's actually happening inside neural networks — which neurons activate for which concepts, how information flows through layers, and why a model makes specific predictions. Techniques include: attention visualization, probing classifiers, and feature visualization (making the input that maximally activates a neuron). Anthropic's 'mechanistic interpretability' team has mapped 'features' in language models corresponding to concepts like 'the Golden Gate Bridge' or emotional states. It's crucial for AI safety.

Put it into practice with AI Learning

This topic — and hundreds more — comes from our free, offline AI Learning app. Practice Q&A, quizzes and cheat sheets anywhere, no account needed.

  • Free
  • No account
  • Works offline
Coming soon toGoogle Play