Neural Structured Learning (NSL) is Google’s open-source TensorFlow framework for training neural networks with structured signals. Published on GitHub under the Apache-2.0 license with about 1,012 stars and still maintained in 2026, NSL implements a learning paradigm in which models learn not only from feature inputs but also from the structure between samples โ expressed explicitly as a graph, or induced implicitly through adversarial perturbation.
Structured signals capture relations or similarity among samples, labeled or unlabeled. By leveraging them during training, NSL harnesses both labeled and unlabeled data, which can improve model accuracy particularly when labeled data is scarce. The framework generalizes two established techniques: Neural Graph Learning, where graph neighbors regularize the model, and Adversarial Learning, where adversarially perturbed samples make models robust against attacks designed to mislead predictions. NSL provides easy-to-use Keras APIs and TensorFlow ops and tools, so developers can add graph-based or adversarial regularization to existing models without rebuilding their training pipelines.
NSL is architecture-agnostic: the same APIs work whether the underlying network is feed-forward, convolutional, or recurrent, and developers can choose between high-level Keras APIs for graph-based and adversarial training or lower-level TensorFlow ops and functions when they need finer control. Google supports the framework with documentation and tutorials on tensorflow.org, including worked examples of graph regularization and adversarial robustness โ the two canonical use cases that show where structured signals help most.
Neural Structured Learning is completely free and open source under the Apache-2.0 license, as part of the TensorFlow ecosystem.
Machine learning engineers working with TensorFlow who have graph-structured data โ recommendations, fraud signals, document networks โ or who need more robust models through adversarial training.