Glossary

YAML

Discover YAML's power in AI/ML! Simplify configurations, streamline workflows, and enhance readability with this versatile data format.

Train YOLO models simply
with Ultralytics HUB

Learn more

YAML Ain't Markup Language (YAML) is a human-readable data-serialization language, often used for configuration files and in applications where data is being stored or transmitted. Designed for simplicity and readability, YAML is particularly valuable in Artificial Intelligence (AI) and Machine Learning (ML) for managing complex configurations related to models, training processes, and deployment pipelines. Its straightforward syntax makes AI/ML workflows more understandable, maintainable, and reproducible.

Key Features of YAML

YAML prioritizes human readability. Its structure relies heavily on indentation to denote hierarchy, similar to Python, which results in cleaner files compared to formats like XML or JSON. Key characteristics include:

  • Human-Readable Syntax: Minimal use of brackets or tags makes files easy to read and edit.
  • Structure through Indentation: Uses spaces (not tabs) to define nested structures, enhancing clarity.
  • Support for Data Structures: Natively supports common data types like scalars (strings, numbers, booleans), lists (sequences), and dictionaries (mappings/key-value pairs).
  • Comments: Allows adding comments using the # symbol for documentation within the file.
  • Versatility: Can represent complex data structures suitable for various configuration needs.

You can learn more about its structure from the official YAML Specification.

YAML in AI and ML Applications

YAML files are widely used in the AI and ML landscape to define and manage various aspects of a project lifecycle, promoting consistency and collaboration by separating configuration from code. Key application areas include:

YAML vs. Other Formats

While YAML serves similar purposes to other data serialization formats, it has distinct characteristics:

  • YAML vs. JSON (JavaScript Object Notation): Both are human-readable and support similar data structures. JSON is stricter, requiring quotes around strings and using braces {} and brackets []. YAML is often considered more readable for complex configurations due to its use of indentation and minimal syntax. However, JSON is more widely used for web APIs. More details can be found at JSON.org.
  • YAML vs. XML (Extensible Markup Language): XML is a markup language defined by the W3C that uses tags (<tag>...</tag>) to define elements. It is more verbose than YAML and JSON. While powerful for document structuring and validation (e.g., in data annotation), XML is generally less preferred for configuration files where readability is paramount compared to YAML's cleaner style.

YAML's focus on human readability makes it an excellent choice for configuration files in AI/ML projects, simplifying management and improving collaboration, especially within platforms like Ultralytics HUB which streamline the ML lifecycle.

Read all