What is the difference between a hard-margin SVM and a soft-margin SVM?

Quick Overview

Asks how a hard-margin support vector machine differs from a soft-margin one. Tests whether you can write both optimization problems, explain when the hard margin fails, describe what slack variables and the penalty C change, and connect the soft margin to the hinge loss and the dual.

What is the difference between a hard-margin SVM and a soft-margin SVM?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

Both versions of the support vector machine look for the separating hyperplane with the widest margin. What is the difference between a hard-margin SVM and a soft-margin SVM? ```hint Stress the constraints Ask what each optimization problem does when the two classes overlap, or when a single mislabeled point sits close to the other class. ``` ### What a Strong Answer Covers - The hard-margin optimization problem and when it has a solution - How slack variables and the penalty weight C change the problem - How sensitive each form is to outliers and label noise - The dual view, and the hinge loss view of the soft margin - How the two relate as C grows, and which one is used in practice ### Follow-up Questions - Why can a single outlier shrink a hard margin drastically even when the data stays separable? - How does an RBF kernel change whether a hard-margin solution exists? - How does the hinge loss in a soft-margin SVM compare with the log loss in logistic regression?

Overview: Asks how a hard-margin support vector machine differs from a soft-margin one. Tests whether you can write both optimization problems, explain when the hard margin fails, describe what slack variables and the penalty C change, and connect the soft margin to the hinge loss and the dual.

Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

Both versions of the support vector machine look for the separating hyperplane with the widest margin. What is the difference between a hard-margin SVM and a soft-margin SVM?

What a Strong Answer Covers Guidance

  • The hard-margin optimization problem and when it has a solution
  • How slack variables and the penalty weight C change the problem
  • How sensitive each form is to outliers and label noise
  • The dual view, and the hinge loss view of the soft margin
  • How the two relate as C grows, and which one is used in practice

Follow-up Questions Guidance

  • Why can a single outlier shrink a hard margin drastically even when the data stays separable?
  • How does an RBF kernel change whether a hard-margin solution exists?
  • How does the hinge loss in a soft-margin SVM compare with the log loss in logistic regression?