Search topics and sections

Garbage in, garbage out (GIGO) is the idea that flawed input produces flawed output. It is a longstanding saying in computing: if a computer gets wrong data or faulty instructions, it gives wrong results.[1][2] Today the phrase is also used about data quality (how accurate, complete, and reliable data are) in other fields, such as health care and machine learning.[3][1]

The phrase started as specialized language among people who worked with early computers.[2] The earliest printed use found so far is a 1957 newspaper story about US Army computer programmers.[2][4] One of them said the machine cannot correct a programmer's mistake because "it can't think for itself."[2]

What the principle says

GIGO says that incorrect or poor-quality input will produce faulty output.[2] A computer, like any process, turns inputs into outputs, so its output can be no better than what it was given.

People also apply the phrase to other processes that they compare to computer data processing.[2]

Garbage in, garbage outGood inputCorrect output23Program: add the numbers5Garbage inputGarbage output28Program: add the numbers10typo, should be 3Same program, same steps. Only the input differs.
The same correct program gives a wrong answer when one input is wrong. Adding 2+32 + 3 gives 55, but a typo turns the 3 into an 8, so the program returns 2+8=102 + 8 = 10, and the computer has no way to know the 8 should have been a 3.

Kinds of garbage

The garbage can be data or instructions.[1] Sources describe several kinds:

  • Wrong data, such as errors made when typing records into a system.[3]
  • Faulty instructions, such as a problem that was "sloppily programmed".[2]
  • Incomplete data, such as a cancer registry (a database that tracks cancer cases) with missing cases, which may give a misleading picture of the disease.[3]
  • Wrong labels, the answers attached to the examples that machine learning systems are trained and tested on.[1][5]

Why the computer cannot fix it

Early computers were seen as processing whatever they were given without questioning it.[6] The 1957 story quoted Army programmer William D. Mellin, who said that if the programmer made mistakes, the machine would make mistakes too, because "it can't think for itself."[2] In 1964 the writer Leonard E. Read made the same point: "a computer cannot exercise judgment; its answers merely reflect the data it receives".[2]

History

Babbage's question

The idea is older than the phrase.[4] In his 1864 memoir, Charles Babbage recalled that he had twice been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?"[7] One asker was a member of the Upper House of Parliament and the other a member of the Lower House.[7][4]

The passage appears in his chapter on the Difference Engine. Babbage wrote that he was "not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."[7]

First uses in print

Early newspaper stories present the phrase as the talk of people who worked with computers.[2] The table lists early printed uses that researchers have found.[2][4]

Date Publication What it shows
10 November 1957 The Hammond Times, Indiana Earliest use found so far. Lists "garbage in-garbage out" among new terms used by Army computer staff.
15 October 1961 The Virginian-Pilot, Virginia Says a machine's reliability "depends on the quality of information fed into it".
11 December 1961 Letter in the Los Angeles Times W. E. Patton says data processing people coined "Gigo" to defend their position.
1 April 1963 Associated Press report by Raymond J. Crowley Describes an Internal Revenue Service processing facility in Martinsburg, West Virginia. Once thought to be the first printed use.
9 February 1964 The Cincinnati Enquirer Gives the longer form GIGOAMS, "garbage in, garbage out at machine speed".
March 1964 The Freeman Leonard E. Read applies GIGO to markets.

In the 1957 story, the phrase comes up during debugging, the step of checking whether the results met the original requirements or the problem should be rerun with corrections.[2]

In early computing the "garbage" could be literal. Atlas Obscura describes the computing world of 1966 as one of trash cans full of punch cards and piles of corrupted magnetic tape.[4]

Timeline of the phrase garbage in, garbage out 1864Babbage memoir: wrongfigures in, rightanswers out? 1958 or 1959Date Fuechsel laterclaimed (in 2004) 1963 (1 Apr)AP report from IRSfacility; oncethought first 2007Anonymous onlineedit creditsFuechsel 1957 (10 Nov)Hammond Times: earliestprint use found(US Army) 1961Virginian-Pilot story;LA Times letter callsGIGO an excuse 1964GIGOAMS: at machinespeed; Read appliesGIGO to markets
Key dates in the history of the phrase. The 1958 or 1959 date is Fuechsel's own later recollection, not a printed use.

Who coined it

No one knows who coined the phrase.[4] A widely repeated story credits George Fuechsel, who taught courses on the IBM 305 RAMAC. The evidence on this claim:[4]

  • The claim. It was added anonymously to an online encyclopedia in 2007 and later repeated in at least five books.
  • Fuechsel's memory. In a 2004 blog comment, he wrote that he came up with the phrase in 1958 or 1959 while teaching a 305 RAMAC course for IBM customers in New York.
  • The earlier source. The 1957 Army story came before Fuechsel's 1958 or 1959 date, and Mellin did not claim to have invented the phrase either.

Fuechsel himself questioned the story: "Since that time, I have believed, and asked friends and family to believe, that I coined the phrase. Did I?"[4] Atlas Obscura noted the irony that the history of this phrase is itself full of bad information.[4]

Spread beyond computing

The phrase soon passed into everyday speech, where it took on a mildly insulting tone.[4]

In March 1964, Read compared a market to a computer that turns data into price signals. He wrote that wrong data makes those signals misleading.[2]

Later writers applied GIGO to health records and to epidemiology.[3][6]

In data quality work

A 2018 editorial on data quality in the Health Information Management Journal describes GIGO as an informal way of recognizing that poor data entry leads to unreliable data output.[3]

Health and research data

The editorial says health data must be highly accurate, or the analyses, applications and business processes that use them will be unreliable.[3] It names four features of data as central to health research, each with problems reported in the journal:[3]

Feature Example of a problem
Accuracy Data entry errors make data inaccurate, which can affect how much funding a healthcare organization receives.
Validity (whether data correctly represent what they claim to describe) A study of death records found mismatches in both coded diagnoses and free-text searches (searches of written text rather than of coded fields).
Completeness Missing cases in a cancer registry may give a misleading picture of the disease.
Availability In one study, failures in written information transfer were the most common information management incident.

Writing about veterinary research, Ulf Emanuelson and Agneta Egenvall state that all data have errors.[6] The task is to keep errors as few as possible, and to find the rest so that their effect on the output can be identified and reduced.[6]

Checking input before use

Software can reject some garbage before using it, through data validation. The Open Worldwide Application Security Project (OWASP), a nonprofit that publishes software security guidance, describes input validation as checking "whether data meets an application's requirements before the application uses it".[8] It recommends two kinds of check:[8]

  • Syntax: the value has the expected type and format.
  • Semantics: the value makes sense for the task. For example, a booking needs valid dates and an end date after its start date.

OWASP and the Common Weakness Enumeration, MITRE's catalog of software weaknesses, both favor an allowlist, or "accept known good", approach. It defines what is acceptable and rejects everything else, instead of trying to list every bad input.[8][9] Missing or faulty checks form a known software weakness, improper input validation.[9]

Input validation gateBooking10 to 12 MarchBooking12 to 10 MarchCheck 1SyntaxRight typeand format?Check 2SemanticsDoes it makesense?End date afterstart date?AcceptProgram usesthe dataRejectPassPassPassFailAllowlist: define what is acceptable, reject the rest
Input validation checks data before a program uses it. A booking whose end date comes before its start date has a valid format but fails the semantic check.

In machine learning

Machine learning covers automated processes that get better at a task with more data, instead of relying only on explicit rules.[1]

Many such systems learn from labeled data, in which one or more people have assessed each item and given it a label.[1] Every way of building a training set, the examples a model learns from, involves some human judgment.[1]

Researchers call wrong labels label noise.[10]

Traditionally, people who use these methods choose which model to use by its accuracy on a labeled test set, examples held back from training and used to score the model.[5] Label errors can therefore affect both what a model learns from and how it is judged.[1][5]

Label errors in a supervised learning workflow People label examples cat dog dog Training set Test set Wrong labels:flawed examples to learn from Wrong labels:misleading scores Northcutt et al. 2021: at least 3.3% wrongon average across 10 popular test sets;at least 6% in ImageNet validation set Training Model Score (accuracy) Choose best model
Label errors can get into the data a model learns from and also into the data used to score it. Northcutt et al. (2021) estimated at least 3.3% wrong labels on average across 10 popular test sets.

Reporting on training labels

A 2020 study titled "Garbage In, Garbage Out?" examined supervised machine learning papers (machine learning from labeled examples) that classified tweets from Twitter.[1] Its authors checked whether each paper said who labeled the data, what instructions the labelers got, and whether labelers agreed with each other. They found wide variation in whether such best practices were followed and documented.[1]

Among the 74 papers that created new human labels, the study found:[1]

  • 33 papers (44.60%) did not report how many people did the labeling, either for the whole project or for each item.
  • About 70% of papers that had several people label the same items reported a measure of inter-rater reliability.
  • None of the papers that used crowdworkers (people hired through online platforms to do tasks such as labeling data) mentioned how they were paid.
  • 8 papers (10.81%) linked to their labeled dataset.

The authors caution against applying these results more broadly to all of machine learning.[1]

Errors in test sets

A 2021 study by Curtis Northcutt, Anish Athalye and Jonas Mueller looked for label errors in the test sets of 10 widely used image, text and audio datasets.[5] Algorithms flagged likely errors, and crowdsourced human reviewers checked them. On average, 51% of the flagged items were indeed mislabeled.[5]

The authors estimated that at least 3.3% of test labels are wrong on average across the 10 datasets.[5] In the ImageNet validation set (a set of examples used to check or tune a model during development), they estimated at least 6%.[5]

They found that lower-capacity models may be more useful than higher-capacity ones on real-world data with many wrong labels.[5] Lower-capacity models are simpler models with fewer parameters, the values a model changes as it learns.

The authors advised judging models on correctly labeled test sets.[5]

How errors pass through a calculation

GIGO does not say how much an input error grows on its way to the output. In numerical analysis, the answer depends on the problem and on the input data.[11]

Condition number

A condition number measures how sensitive the solution of a problem is to small changes in its input data.[11] For small input errors, it sets an approximate upper limit on the relative error in the output, meaning the error as a fraction of the true value:[11]

∥f(x+Δx)−f(x)∥∥f(x)∥≲cond⁡(f,x) ∥Δx∥∥x∥\frac{\lVert f(x+\Delta x)-f(x)\rVert}{\lVert f(x)\rVert} \lesssim \operatorname{cond}(f,x)\,\frac{\lVert \Delta x\rVert}{\lVert x\rVert}

Here ff is the calculation, xx is the correct input, Δx\Delta x is a small error in that input, and ∥⋅∥\lVert\cdot\rVert measures size. Both xx and f(x)f(x) must be nonzero. The bound is close to an equality for some errors Δx\Delta x.[11]

The derivative f′f' of a function is the rate at which its value changes as its input changes. For a function of one variable, the condition number is:[11]

cond⁡(f,x)=∣x f′(x)f(x)∣\operatorname{cond}(f,x)=\left\lvert\frac{x\,f'(x)}{f(x)}\right\rvert

A problem is well conditioned if this number is small and ill conditioned if it is large, where "small" and "large" depend on the context.[11] In an ill-conditioned problem, small input changes can produce large output changes, though they do not always do so.[11]

The table applies the formula to a 0.1% input error. For the logarithm, f′(x)=1/xf'(x)=1/x, so the condition number is 1/∣ln⁡x∣1/\lvert\ln x\rvert.[11]

Calculation Condition number Output error from a 0.1% input error
f(x)=2xf(x)=2x 1 about 0.1%
f(x)=xf(x)=\sqrt{x}, with x>0x>0 1/2 about 0.05%
f(x)=ln⁡xf(x)=\ln x, at x=1.01x=1.01 1/∣ln⁡1.01∣≈1001/\lvert\ln 1.01\rvert\approx 100 about 10%

The same small input error can shrink, pass through unchanged, or grow about a hundredfold.

Well-conditioned and ill-conditioned functions Well conditioned Ill conditioned Input x Input x Output f(x) Output f(x) Input error Input error Small output error Large output error
The same small input error gives a small output error in a well-conditioned problem and can give a large one in an ill-conditioned problem.

Random measurement errors

Measured inputs often carry random errors. Three terms describe them:

  • Mean: the average of repeated measurements.
  • Standard deviation: how far values typically fall from the mean.
  • Variance: the square of the standard deviation.

Propagation of uncertainty estimates how this spread carries into a computed result.[12] For a result w=F(x)w=F(x) computed from one measured value xx, a 1966 National Bureau of Standards paper gives:[12]

var⁡(w)≈(dFdx)2var⁡(x)\operatorname{var}(w)\approx\left(\frac{dF}{dx}\right)^{2}\operatorname{var}(x)

Here var⁡\operatorname{var} is the variance, and the derivative dF/dxdF/dx is taken at the mean of xx; it sets how strongly the input's spread reaches the output. The mean of ww is then about FF evaluated at the mean of xx.[12] The approximation holds when the standard deviations are small compared with the means and the second and higher derivatives of FF are not unusually large.[12]

Limits and criticism

Learning from noisy labels

Some methods tolerate a lot of garbage. In a 2017 study, deep neural networks performed well on test data after training on data in which wrong labels greatly outnumbered correct ones.[10] On the MNIST dataset, test accuracy stayed above 90 percent even when 100 randomly labeled examples were mixed in with each correctly labeled training example.[10]

The networks needed a much larger training set to make up for the noise. The extra size was related to how many wrong labels were mixed in with each correct one.[10]

Garbage in, gospel out

A variant, "garbage in, gospel out", describes putting too much trust in anything a computer produces.[6] Emanuelson and Egenvall argue that this makes careful checking of data even more important when conclusions rest on large statistical analyses.[6]

An excuse for poor systems

The phrase has also been criticized as an excuse. In his 1961 letter to the Los Angeles Times, W. E. Patton wrote that data processing people coined "Gigo" "to defend their position".[2] He argued that a proper system should include input, processing and output, with controls to secure the proper results at each step.[2]

References

  1. Garbage In, Garbage Out? Do Machine Learning Application Papers in Social Computing Report Where Human-Labeled Training Data Comes From?, ACM Conference on Fairness, Accountability, and Transparency, 2020.
  2. 'garbage in, garbage out': meaning and origin, word histories, 2022.
  3. Data quality: 'Garbage in - garbage out', Health Information Management Journal, 2018.
  4. Is This the First Time Anyone Printed, 'Garbage In, Garbage Out'?, Atlas Obscura, 2016.
  5. Pervasive Label Errors in Test Sets Destabilize Machine Learning Benchmarks, NeurIPS Track on Datasets and Benchmarks, 2021.
  6. The data - Sources and validation, Preventive Veterinary Medicine, 2014.
  7. Passages from the Life of a Philosopher, Longman, Green, Longman, Roberts, & Green, 1864.
  8. Input Validation Cheat Sheet, OWASP Foundation, n.d.
  9. CWE-20: Improper Input Validation, MITRE, n.d.
  10. Deep Learning is Robust to Massive Label Noise, arXiv, 2017.
  11. What Is a Condition Number?, Nick Higham, 2020.
  12. Notes on the Use of Propagation of Error Formulas, Journal of Research of the National Bureau of Standards, 1966.

Figure

Subtopics