← All whitepapers

Formal Methods vs. Machine Learning: Computational Cost and Truth Affinity

Francisco Javier Jiménez Gómez · v1.0 · 30 December 2025 · Draft

Abstract

This paper compares two paradigms for building AI systems: formal methods (specification, verification, synthesis) and machine learning (ML, particularly deep learning). We introduce the concept of truth affinity—the propensity of a system to produce correct, justifiable, and verifiable outputs—and analyze the computational cost of each approach across three axes: initial development, training/verification, and maintenance. We also examine the factors that change the cost ratio over time and the emergence of hybrid systems that combine the strengths of both paradigms. The analysis is grounded in the LAIA project's commitment to formal, verifiable reasoning.

Formal Methods vs. Machine Learning: Computational Cost and Truth Affinity

DOI: 10.5281/zenodo.24356471 · Zenodo · cite this version

Abstract

This paper compares two paradigms for building AI systems: formal methods (specification, verification, synthesis) and machine learning (ML, particularly deep learning). We introduce the concept of truth affinity—the propensity of a system to produce correct, justifiable, and verifiable outputs—and analyze the computational cost of each approach across three axes: initial development, training/verification, and maintenance. We also examine the factors that change the cost ratio over time and the emergence of hybrid systems that combine the strengths of both paradigms. The analysis is grounded in the LAIA project’s commitment to formal, verifiable reasoning.

1. Introduction

In the coming generations, two paradigms will compete and complement each other:

Each paradigm has distinct strengths and weaknesses in terms of computational cost and the ability to produce trustworthy outputs.

2. Truth Affinity: Definitions

Truth affinity is the ability of a system to produce outputs that:

  1. Correspond to verifiable facts, invariants, or requirements;
  2. Justify why the output is correct.

2.1 Formal Methods

2.2 Machine Learning

3. Computational Cost

We analyze cost across three axes: initial development, training/compiling/verification, and maintenance/adaptation.

3.1 Short Term (1–3 Years)

3.2 Medium Term (3–7 Years)

3.3 Long Term (>7 Years)

4. Guidance Estimates

ApproachDevelopment CostCompute CostMaintenance
Formal methodsHigh human cost to specifyVerification can be intensive (10²–10⁴ core-seconds for non-trivial modules)Efficient with good modularity
MLModerate (data labeling)10⁶–10⁹ GPU-seconds for large modelsContinuous retraining

5. Factors That Change the Cost Ratio

6. Hybrid Systems

The most promising direction is the convergence of formal methods and ML:

The LAIA project embodies this hybrid philosophy, grounding AI reasoning in formal logic while leveraging the scalability of modern computation.

7. Conclusion

Neither paradigm is universally superior. The choice between formal methods and ML—and the optimal balance between them—depends on the domain, the availability of specifications vs. data, and the required level of truth affinity. The future lies in hybrid systems that combine the rigor of formal methods with the scalability of machine learning.

8. Future Work

References

  1. Jiménez Gómez, F. J. (2025). Computational cost and truth affinity: formal languages vs ML (Draft).
  2. Jiménez Gómez, F. J. (2026). ACS: An Assistant Context Standard. LAIA Whitepapers.
  3. LAIA Project. Ethical Artificial Intelligence. https://laia.brisecom.org/

Cite as: Francisco Javier Jiménez Gómez (2025). Formal Methods vs. Machine Learning: Computational Cost and Truth Affinity. LAIA / Brisecom SL. DOI: 10.5281/zenodo.24356471