AI GLOSSARY · AI CONCEPTS
JAX (library)
Definition
JAX is a Python library for numerical array computation and composable transformations such as automatic differentiation, vectorization and compilation across supported CPU, GPU and TPU backends.
Also called: JAX.
In plain language
JAX helps developers express numerical work with a NumPy-style array API and transform compatible functions. grad creates derivative functions, vmap maps a function across array axes and jit compiles compatible computations. JAX is used in machine-learning research, but it is neither a language model nor an LLM runtime. Its transformations favor functionally pure numerical code. JIT compilation has an upfront cost, is not guaranteed to make every function faster and may happen again when shapes, dtypes, static argument values, function identity or other compilation conditions change.
Technical definition
JAX provides accelerator-oriented array operations and composable program transformations. jax.grad differentiates scalar-output numerical functions; jax.vmap vectorizes function application over array axes; and jax.jit traces and compiles JAX-compatible functions for XLA execution. Cached compiled code can be reused by later calls with a compatible compilation signature. Changes such as input shape or dtype, static argument values, or function identity can require another trace or compilation. Python side effects are not represented like JAX numerical primitives and can behave unexpectedly under transformations. CPU, GPU and TPU are supported backends, but backend availability and suitable code do not establish a performance improvement for a particular workload.
Worked examples
Self-contained illustrations work through the concept directly. Their scenarios and results are explanatory, not measured model-performance claims.
Illustrative example · not a measured performance result
Differentiate and vectorize a square function
- Scenario
- This explicitly hypothetical, illustrative example shows how JAX transformations can be composed for tiny floating-point inputs. The code is unexecuted and is not a hardware benchmark.
- Demonstration
- For f(x) = x × x, calculus gives f′(x) = 2x. Therefore the derivative at 3.0 is 6.0. Applying that gradient independently to [1.0, 2.0, 3.0] gives [2.0, 4.0, 6.0].
jax.gradconstructs the derivative function,jax.vmapapplies it across the vector andjax.jitmay compile the vectorized computation. - Illustrative code
import jax import jax.numpy as jnp def f(x): return x * x grad_f = jax.grad(f) vector_grad_f = jax.vmap(grad_f) compiled_vector_grad_f = jax.jit(vector_grad_f) x = jnp.array(3.0, dtype=jnp.float32) xs = jnp.array([1.0, 2.0, 3.0], dtype=jnp.float32) # Illustrative, unexecuted expectations: # grad_f(x) -> 6.0 # compiled_vector_grad_f(xs) -> [2.0, 4.0, 6.0]- What it shows
- Use
gradfor differentiation, addvmapwhen the same scalar calculation should run across a batch, and applyjitonly where compilation suits the function and workload. - Limits
- The expected values follow directly from the stated function; they are not reported execution results. This example does not measure speed, demonstrate every supported dtype or backend, or guarantee cache reuse or improvement from JIT.
How it shows up when you use agents
JAX appears when an agent reads or modifies Python for numerical computing or machine-learning research. It is an array-computing and program-transformation library, not a language model, chatbot or LLM-serving runtime. Its NumPy-style API supports array operations, while transformations such as jax.grad, jax.vmap and jax.jit can differentiate, vectorize and compile suitable functions.
Ask the agent to identify what transformation the code actually needs. grad is appropriate when a scalar-output numerical function needs derivatives. vmap is appropriate when one function should be applied across a batch axis without writing a manual loop. jit is appropriate when a JAX-compatible computation may benefit from compilation. These tools can be composed, but they are not an automatic recipe for optimizing every training loop or porting every PyTorch or TensorFlow program. State handling, control flow, library dependencies, sharding and surrounding architecture may require redesign.
When reviewing generated code, request small correctness checks before performance work. Compare the intended mathematics with the plain and transformed functions on tiny inputs. Check shapes, dtypes and static arguments. Also inspect Python side effects: JAX transformations trace numerical operations, and ordinary mutation or printing may not behave as a reader expects inside transformed code.
Common confusions
JAX resembles NumPy, but a familiar interface does not mean every NumPy program transfers unchanged. JAX transformations are designed around compatible, functionally pure computations. A GPU or TPU is hardware; JAX is software that can target supported CPU, GPU and TPU backends.
JIT compilation is also not a universal speed switch. Compilation has an upfront cost, and later calls reuse cached code only when their compilation conditions are compatible. Changed shapes, dtypes, static argument values or function identities can trigger further tracing or compilation. Small computations may not benefit once overhead is considered.
For an agent-assisted change, the useful action is to define the expected numerical result, test representative shapes and dtypes, and then profile the real workload on its intended backend. Do not substitute local-LLM memory sizing or API-cost tools: those answer different questions and provide no evidence about a JAX program’s correctness, memory use or performance.
Related terms
Terms that mention JAX (library)
1 terms mention this one
More in AI concepts
Sources
- JAX: High performance array computing, JAX project (accessed 2026-11-25)
- Just-in-time compilation, JAX project (accessed 2026-11-25)
- Using JAX to accelerate our research, Google DeepMind (accessed 2026-11-25)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-25. Wikipedia is never the only source.
Review record
Last verified
Drafted by claude-sonnet-5-5; revisions: OpenAI Codex (configured gpt-5.6-sol); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-25. Last verified .
Change log (5)
- : Independent full source/reader review plus bounded self-link closure completed. Standalone example is explanatory, not a measured service or hardware benchmark. New-feature runtime gate recorded separately; publication disabled.
- : Private source-based correction with self-contained illustration; independent full source/reader and new-feature runtime gates pending. Example is illustrative, not a measured model benchmark.
- : First version.
- : Verifier pass: removed absolute and unsourced product claim, narrowed technical wording.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.