esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

Softmax vs Sigmoid

When to use softmax or sigmoid, what each one does to a model's scores, and which loss goes with which, explained for your AI interview.

In short

Sigmoid scores each label on its own, so several labels can be yes at once. Softmax turns all the scores into shares that add up to 1, so the labels compete and the biggest share is the pick.

12 min readBeginnerCommon · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Sigmoid and softmax both turn raw scores into numbers between 0 and 1, but they answer different questions. Sigmoid scores each label on its own, so a ticket can get several yes answers. Softmax scores all the labels together, and the shares add up to 100%, so the labels compete and the biggest share is the pick. The first question I ask is whether one example can have more than one label. Then I pick the function and the loss that goes with it.

What are softmax and sigmoid, in plain words?

A model gives every possible label a raw score, called a logit. A logit can be any number, positive or negative, and on its own it means little to a person. Sigmoid and softmax are two ways to turn those scores into answers people can use.

Sigmoid is a curve that takes any number and squeezes it into a range from 0 to 1. Each score goes through it by itself, so each label ends up with its own chance. Softmax looks at all the scores at once and turns them into shares of one whole. The shares always add up to 100%, so a bigger share means a smaller share for someone else.

Think of a loan application form. The customer can tick home loan, car loan and credit card, or any mix of the three. That is sigmoid: a separate yes or no for each box. Now think of a branch that must send each application to exactly one underwriting queue. That is softmax: the queues share the whole, and one of them wins. In an AI app, the same choice decides whether a support ticket can carry two tags or must go to exactly one queue. The bank case later in this answer uses both.

Key words

Logit
The raw score a model gives each possible label, before any scaling. It can be negative.
Sigmoid
A curve that turns any number into a value from 0 to 1, one score at a time.
Softmax
A function that turns all the scores into shares that add up to exactly 1.
Multi-class
Exactly one label per example, chosen from three or more labels.
Multi-label
Any number of labels on one example, each one on or off.

How do the two functions shape their answers?

  • Sigmoid

    Each label on its own

    Every score goes through the curve by itself, so each label gets its own answer between 0 and 1. The answers do not have to add up to anything, so several can be high at once.

  • Softmax

    All labels compete

    The scores are weighed against each other, so the shares add up to exactly 1. A bigger share for one label always takes share away from another.

Google's machine learning course describes the same split, under two names. One-vs.-all means one separate yes or no model for each label, each asking 'this label or not'. The course applies a sigmoid to each output on its own, so the outputs need not sum to 1. The course calls the softmax approach one-vs.-one. That is not the same as scikit-learn's one-vs-one method, which trains one classifier for each pair of classes, so do not mix the two up.

  • “For one-vs.-all, we applied the sigmoid activation function to each output node independently, which resulted in an output value between 0 and 1 for each node, but did not guarantee that these values summed to exactly 1.”

    Google Machine Learning Crash Course, multi-class

  • “For one-vs.-one, we can instead apply a function called softmax, which assigns decimal probabilities to each class in a multi-class problem such that all probabilities add up to 1.0.”

    Google Machine Learning Crash Course, multi-class

Two ways to turn scores into answers

Model's raw scores

One score per label, any number

Sigmoid: each label alone

Sigmoid per label

Each score becomes 0 to 1

Softmax: labels compete

Softmax over all

Scores become shares of 100%

Many tags can be on

Fraud and billing at once

Top share is the pick

Shares add up to exactly 1

  1. 1Each label's raw score goes to sigmoid on its own.
  2. 2All the raw scores go to softmax together.
  3. 3Sigmoid's answers can all be yes at once.
  4. 4Softmax hands back shares, so the labels compete.
One model's raw scores can go two ways. Sigmoid answers each label separately, so several can be yes. Softmax makes shares of one whole, so the labels compete and the biggest share is the pick.

Both functions keep the order of the scores, so the top score still ends up with the top answer. What changes is whether the answers have to compete with each other.

How do you choose for a real bank ticket system?

Take a mid-size bank's support inbox, with about 40,000 made-up tickets a month. The model reads each ticket and must do two jobs. Routing needs exactly one queue: card disputes, loan servicing or account access. Tagging needs any mix of fraud check, billing and urgent, because one ticket can be all three at once.

  • “Softmax assumes that each example is a member of exactly one class.”

    Google Machine Learning Crash Course, multi-class

  • “Some examples, however, can simultaneously be a member of multiple classes.”

    Google Machine Learning Crash Course, multi-class

So routing uses softmax, and tagging uses one sigmoid per tag. Google's course says that when an example can carry several labels, you must use several logistic regressions instead of softmax. A logistic regression is a simple yes or no model, and each one here is a sigmoid on a single label. The loss is the score that says how wrong the model was, and training pushes it down. Cross-entropy is the usual loss for these outputs. PyTorch is a widely used deep-learning library, and its loss functions are covered in the loss setup section.

Pick the function and the loss together

One label or several?

The question to ask first

Exactly one label

Softmax

Shares that add up to 1

Any mix of labels

Sigmoid per label

A yes or no score each

Cross-entropy loss

Pairs with a softmax output

Binary cross-entropy

Pairs with a sigmoid output

  1. 1One label per ticket: the softmax path.
  2. 2Several labels can be on: the sigmoid path.
  3. 3Softmax's shares train with cross-entropy.
  4. 4Each sigmoid output trains with binary cross-entropy.
Ask first whether one example can have several labels. Exactly one label means softmax, and any mix means a sigmoid for each label. Each path has its own loss, which trains it.

Here is the same idea in plain Python, with made-up logits for the two jobs. Lines 10 to 14 hold softmax and lines 17 and 18 hold sigmoid.

Python
# A bank's support model scores one incoming ticket. The logits are made-up numbers.
import math

QUEUES = ["card disputes", "loan servicing", "account access"]
queue_logits = [2.0, 0.5, -1.0]  # exactly one queue must get the ticket
TAGS = ["fraud check", "billing", "urgent"]
tag_logits = [1.5, 0.8, -2.0]  # a ticket can carry several tags


def softmax(scores):
    top = max(scores)  # subtract the top score first, so exp() stays small
    exps = [math.exp(s - top) for s in scores]
    total = sum(exps)
    return [e / total for e in exps]


def sigmoid(score):
    return 1 / (1 + math.exp(-score))


print("One queue (softmax, shares add up to 1):")
for name, p in zip(QUEUES, softmax(queue_logits)):
    print(f"  {name:<16}{p:.3f}")
print(f"  {'total':<16}{sum(softmax(queue_logits)):.3f}")
print("Several tags (sigmoid, each on its own):")
for name, s in zip(TAGS, tag_logits):
    print(f"  {name:<16}{sigmoid(s):.3f}")
print(f"  {'total':<16}{sum(sigmoid(s) for s in tag_logits):.3f}")
gap = tag_logits[0] - tag_logits[1]
print(f"Two options: softmax gives {softmax(tag_logits[:2])[0]:.3f}, sigmoid of the gap gives {sigmoid(gap):.3f}")

Output

One queue (softmax, shares add up to 1):
  card disputes   0.786
  loan servicing  0.175
  account access  0.039
  total           1.000
Several tags (sigmoid, each on its own):
  fraud check     0.818
  billing         0.690
  urgent          0.119
  total           1.627
Two options: softmax gives 0.668, sigmoid of the gap gives 0.668

Two things to see. The queue shares add up to 100%, but the tag scores add up to 1.627, which is fine, because each tag stands on its own. And the last line shows the two-option case: softmax over two scores gives the same number as sigmoid of their gap.

How would you set up the loss for this model?

  1. 1

    Pick the output shape first

    Queue routing gets a softmax over the queues. Tagging gets one sigmoid per tag.

  2. 2

    Use the loss built for that output

    PyTorch's binary loss for logits includes the sigmoid in one class. Its cross-entropy loss takes raw logits and applies a log-softmax inside, which is a softmax step followed by a log.

  3. 3

    Feed raw logits, once

    Do not put a sigmoid or softmax layer in front of these losses. Applying the function twice feeds the loss the wrong numbers.

  4. 4

    Check the shapes in a test

    Run one ticket through. The queue shares should add up to 1, and each tag score should sit between 0 and 1.

PyTorch's cross-entropy page says its input is the raw logits for each class, which need not be positive or add up to 1. Its binary loss page says combining the sigmoid and the loss in one class is more numerically stable than a plain sigmoid followed by a binary loss.

Tip

Asked how you would build the output layer, start with the shape of the answer. Exactly one label means softmax with cross-entropy. Several labels mean sigmoid with binary cross-entropy. In both cases, the loss takes the raw logits.

What does the interviewer want to hear?

A strong answer covers

  • Sigmoid scores each label alone, so several can be yes at once.
  • Softmax makes shares that add up to 1, so the labels compete.
  • The first question: can one example have more than one label?
  • Loss pairing: binary cross-entropy with sigmoid, cross-entropy with softmax.
  • Both losses take raw logits, so the function is never applied twice.
  • Limits: full softmax gets costly with many classes, and a share shows lean, not accuracy.

Common traps

  • Trap"Sigmoid is for yes or no, and softmax is for many classes."

    BetterAsk whether one example can have several labels. With several labels, use a sigmoid for each label, even with many classes.

  • Trap"Softmax is better because its output is a probability."

    BetterBoth give numbers between 0 and 1. The real question is whether the labels can overlap.

  • Trap"The loss needs a sigmoid, so I add one before it."

    BetterThe binary loss already applies the sigmoid. Pass the raw logits, or the numbers go through the function twice.

Can you spot the mistake?

Spot the mistake

A teammate builds the ticket model. Which setup is wrong?

Quick check

A ticket can be both a fraud check and urgent. Which output fits?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q022What are logits, and what does softmax do?11 min
  2. Q419MSE vs cross-entropy loss?11 min
  3. Q432What is logistic regression?11 min
  4. Q278How do you evaluate an LLM classifier (confusion matrix)?12 min

Learn it in depth

Last updated on 27 November 2026

Building a model that routes or tags tickets?

Venkat designs and builds AI products and agents, the interface and the system behind it. Book a short call and say what you need, and I will talk you through whether a model fits.