The interaction between bases on different strands depends somewhat on the neighboring bases.  Instead of treating a DNA helix as a string of interactions between base pairs, the nearest-neighbor model treats a DNA helix as a string of interactions between neighboring base pairs.  So, for example, the DNA shown below has nearest-neighbor interactions indicated by the arrows.
The free energy of forming this DNA from the individual strands, ΔG°, is represented (at 37 °C) as
ΔG°(predicted) = ΔG°(C/G initiation) + ΔG°(CG/GC) + ΔG°(GT/CA) + ΔG°(TT/AA) + ΔG°(TG/AC) + ΔG°(GA/CT) + ΔG°(A/T initiation)
Except for the C/G initiation term, the first term represents the free energy of the first base pair, CG, in the absence of a nearest neighbor.  The second term includes both the free energy of formation of the second base pair, GC, and stacking interaction between this base pair and the previous base pair.  The remaining terms are similarly defined.  In general, the free energy of forming a nucleic acid duplex is
where  represents the free energy associated with one of the ten possible the nearest-neighbor nucleotide pairs, and  represents its count in the sequence.
Each ΔG° term has enthalpic, ΔH°, and entropic, ΔS°, parameters, so the change in free energy is also given by
Values of ΔH° and ΔS° have been determined for the ten possible pairs of interactions.  These are given in Table 1, along with the value of ΔG° calculated at 37 °C.  Using these values, the value of ΔG° for the DNA duplex shown above is calculated to be −22.4 kJ/mol.  The experimental value is −21.8 kJ/mol.
The parameters associated with the ten groups of neighbors shown in table 1 are determined from melting points of short oligonucleotide duplexes. It works out that only eight of the ten groups are independent.
The nearest-neighbor model can be extended beyond the Watson-Crick pairs to include parameters for interactions between mismatches and neighboring base pairs. This allows the estimation of the thermodynamic parameters of sequences containing isolated mismatches, like e.g. (arrows indicating mismatch)
These parameters have been fitted from melting experiments and an extension of Table 1 which includes mismatches can be found in literature.
A more realistic way of modeling the behavior of nucleic acids would seem to be to have parameters that depend on the neighboring groups on both sides of a nucleotide, giving a table with entries like "TCG/AGC". However, this would involve around 32 groups for Watson-Crick pairing and even more for sequences containing mismatches; the number of DNA melting experiments needed to get reliable data for so many groups would be inconveniently high. However, other means exist to access thermodynamic parameters of nucleic acids:  microarray technology allows hybridization monitoring of tens of thousands sequences in parallel. This data, in combination with molecular adsorption theory allows the determination of many thermodynamic parameters in a single experiment and to go beyond the nearest neighbor model. In general the predictions from the nearest neighbor method agree reasonably well with experimental results, but some unexpected outlying sequences, calling for further insights, do exist. Finally, we should also mention the increased accuracy provided by single molecule unzipping assays which provide a wealth of new insight into the thermodynamics of DNA hybridization and the validity of the nearest-neighbour model as well.