Motivation: Existing methods for protein sequence analysis are generally firstorder and inherently assume that each position is independent. We develop a general framework for introducing longer-range interactions. We then demonstrate the power of our approach by applying it to secondary structure prediction; under the independence assumption sequences produced by existing methods can produce features that are not protein-like, an extreme example being a helix of length one. Our goal was to make the predictions from state of the art methods more realistic, without loss of performance by other measures. Results: Our framework for longer-range interactions is described as a kmer order model. We succeeded in applying our model to the specific problem of secondary structure prediction, to be used as additional layer on top of existing methods. We achieved our goal of making the predictions more realistic and protein-like, and remarkably this also improved the overall performance. We impro...