VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

University Research Random Seeds: Re-run the Analysis and Find What Still Changes

A researcher records a random seed and environment beside a laptop and compares charts from repeated analyses.

HOW SINGAPORE EDUCATION WORKS · University reproducibility

Find your next learning step

Record the random-number generator, seed and environment; rerun from a clean start; then compare both exact outputs and scientific conclusions. A seed controls one source of variation, not every source.

Full chapter index · Practice and checking · Sources and next reading · How Singapore Education Works

Randomised data splits, simulations, bootstrap samples, parameter initialisation and stochastic optimisation can produce different outputs from the same code. A recorded seed makes a pseudorandom sequence repeatable within defined conditions, but it does not freeze software versions, parallel execution, hardware behaviour or hidden data changes.

This is a reproducibility workflow, not a claim that every result must be bit-for-bit identical. Universities, labs and journals may set additional research-data, software, ethics and security requirements. Use the project’s approved environment and never publish confidential data, credentials or restricted paths in a notebook or repository.

The choices at a glance

What you noticeLikely issueUseful next move
Two reruns use different train/test splitsThe split generator or seed was not controlledPass an explicit random-state object or seed and record it
The seed is fixed but model scores still move slightlyAnother nondeterministic layer remainsCheck parallelism, hardware, libraries and operation settings
One seed produces a strong result that disappears laterThe conclusion depends on a lucky drawReport a distribution across justified seeds, not one attractive run
A diagnostic route map; adapt the teaching or workflow move to the learner and follow the responsible institution’s instructions.

Full chapter index

See the structure
  1. A seed starts a deterministic pseudorandom stream
  2. Build a randomness register before rerunning
Work and diagnose
  1. Worked case: a seeded split and stochastic model
  2. Separate exact repeatability from robust conclusions
Repair and practise
  1. Diagnose residual nondeterminism layer by layer
  2. Move from one rerun to an independent restoration
Recall, transfer and questions
  1. Recall later and transfer across tools and countries
  2. Frequently asked questions

CHAPTER 1 OF 8

1. A seed starts a deterministic pseudorandom stream

Back to contents

A pseudorandom number generator produces a sequence from an internal state. Initialising it from the same seed can reproduce the sequence when the generator and relevant software behaviour are the same. The seed is therefore an input to the analysis.

The seed does not make the method non-random. It makes one realisation traceable. Research questions about uncertainty often require many seeds or many resamples; research questions about debugging may require one repeated seed.

Prefer the explicit random generator recommended by the library rather than relying on a global setting hidden elsewhere. Record where randomness enters the pipeline.

Contents · Next chapter

CHAPTER 2 OF 8

2. Build a randomness register before rerunning

Back to contents

List every stochastic step: sampling, data split, augmentation, initialisation, shuffling, optimisation and evaluation. For each, record the library, generator API, seed strategy and output that should be compared.

LayerRecordCheck
DataInput identifier and split indicesSame rows and same order?
RandomnessGenerator, seed or SeedSequenceSame stream at the intended step?
SoftwareLanguage, library and lockfile versionsSame implementation path?
ExecutionCPU/GPU, threads and deterministic flagsKnown nondeterministic operations?
ResultMetric, tolerance and artefact hashExact match or scientifically equivalent?
A seed is one row in a larger reproducibility record.

If separate steps need independent randomness, derive child streams deliberately rather than reusing one mutable generator accidentally. The exact mechanism depends on the library.

Contents · Previous chapter · Next chapter

CHAPTER 3 OF 8

3. Worked case: a seeded split and stochastic model

Back to contents

Assumptions: a project has 1,000 labelled records. It uses an 80/20 train/test split with random_state 20261023 and a stochastic classifier with random_state 31415. The locked environment and input file hash are recorded. Run A reports accuracy 0.842 and stores the 200 test-row identifiers.

From a clean process, Run B restores the same environment, verifies the input hash, applies the same split seed and checks the test identifiers before fitting with the model seed. It also reports 0.842. Run C keeps the split but changes the model seed to 27182 and reports 0.839.

Checked answer: Runs A and B reproduce the defined seeded pipeline. Run C tests model-seed sensitivity while holding the evaluation set fixed; the absolute score change is 0.003. That difference is evidence to analyse, not permission to select the higher run. The research conclusion must reflect the planned analysis across seeds and uncertainty.

Contents · Previous chapter · Next chapter

CHAPTER 4 OF 8

4. Separate exact repeatability from robust conclusions

Back to contents

Exact repeatability asks whether the same inputs and conditions recreate the same bits or values. Computational reproducibility may accept a stated numeric tolerance. Robustness asks whether the substantive conclusion survives reasonable changes in seed, sample or model settings.

Define the comparison before rerunning. A file hash should match exactly; a floating-point metric may use a justified tolerance; a chart may need both data and visual checks. Avoid deciding the threshold after seeing the difference.

A conclusion that holds across a planned range of seeds is stronger than one chosen from many unreported attempts. Keep unsuccessful or ordinary runs in the record.

Contents · Previous chapter · Next chapter

CHAPTER 5 OF 8

5. Diagnose residual nondeterminism layer by layer

Back to contents

First verify input bytes and row order. Next verify that every stochastic component received the intended generator or seed. Then compare package versions, compiler or accelerator libraries, thread counts and deterministic-operation settings.

Run the smallest failing component repeatedly. If data splitting changes, do not debug the model yet. If the split is stable but training differs, isolate initialisation, batching and parallel operations.

Document what remains nondeterministic and why. Hiding a small unresolved variation is worse than reporting its measured range and the conditions under which it appears.

Contents · Previous chapter · Next chapter

CHAPTER 6 OF 8

6. Move from one rerun to an independent restoration

Back to contents

Guided rerun

  1. Restart the process and load inputs from named paths.
  2. Set explicit generators at every stochastic step.
  3. Compare stored indices, metrics and artefacts.

Sensitivity run

  • Change one seed according to a written plan.
  • Keep the evaluation definition fixed where appropriate.
  • Summarise the distribution, not only the maximum.

Independent restoration

A colleague uses the README, locked environment, seed register and data instructions on a clean machine or approved workspace, then records matches and deviations.

Contents · Previous chapter · Next chapter

CHAPTER 7 OF 8

7. Recall later and transfer across tools and countries

Back to contents

A week later, rebuild the randomness register from the repository without opening a private notebook. Missing seeds or undocumented global state should become visible during this delayed handover.

International research teams may use different operating systems, processors and compute clusters. The portable method is to declare inputs, generators, seeds, environment and comparison rule, then report what is and is not identical.

Changed-context check: port the analysis from a laptop CPU to an approved GPU service. Keep the same data and seed plan, document the hardware change and test whether numerical differences alter the scientific conclusion.

Contents · Previous chapter · Next chapter

CHAPTER 8 OF 8

8. Frequently asked questions

Back to contents

Does setting one global seed solve reproducibility?

No. Libraries can use separate generators, and environment, data and parallel operations can still vary. Pass randomness explicitly where the API supports it.

Should every experiment use the same seed?

Use a fixed seed for a repeatability check. Use a predeclared set or sampling plan when studying sensitivity. The design should answer the research question.

What seed number is best?

There is no scientifically lucky seed. Choose and record it before interpreting the result.

Must results match exactly?

Not always. Define whether the artefact requires exact equality, numeric tolerance or stable scientific interpretation, and justify that rule.

Contents · Previous chapter · Series hub

Sources and next reading

Continue inside eduKateSG