General notions of "basis" in algebra/model theory Free groups, free abelian groups, and vector spaces all have a notion of 'basis': a subset $B$ of the structure such that everything in the structure can be written uniquely as a finite combination of elements of $B$.


*

*What is the most general (model theoretic) structure for which it makes sense to think about a basis?

*Do all of these structures have theorems along the lines of "if $S$ is a structure with a basis and $T$ is a substructure, then $T$ must also have a basis"? This certainly is true for free (abelian) groups and vector spaces.
 A: The notion of basis can be generalized in multiple ways. The way it seems like you're thinking of - a basis for a structure $A$ is a subset $S\subseteq A$ such that every element of $A$ can be expressed uniquely (in some sense) as a term using parameters from $S$ - is more a notion of universal algebra than of model theory: Look into free algebras.
In this reading of the question, the answer to (2) is no. For example, consider the free monoid on one generator. This is isomorphic to $\langle \mathbb{N}, 0, +\rangle$, and $\{1\}$ is a basis. Now consider the submonoid with domain $\mathbb{N}\setminus \{1\}$. This submonoid is generated by $2$ and $3$, and it's not hard to see that any generating set must contain $2$ and $3$. But no generating set is a basis, since $6$ can be written as $2+2+2$ or as $3+3$.
Another way to generalize is the abstract notion of a matroid. Matroids also get involved in model theory, though model theorists tend to call their matroids "pregeometries". There are various natural closure operators that you can associate to models of a complete first-order theory $T$, the most prominent being algebraic closure, acl. Under certain conditions, these closure operators will satisfy the matroid axioms, giving rise to notions of basis and dimension for models of $T$. For example, in a strongly minimal theory, acl gives a pregeometry - in the theory of $k$-vector spaces, acl is Span and the dimension is linear dimension, while in the theory of algebraically closed fields, $\text{acl}(X)$ is the algebraic closure of the field generated by $X$ and the dimension is transcendence degree. 
In the model-theoretic situation, sometimes the existence of a nice pregeometry is guaranteed by elementary properties of the theory (for example, the property of being strongly minimal), and then an elementary substructure of a structure with a basis will still have a basis (since it shares the pregeometry).
