## 1 Introduction  
Single-stranded RNA molecules consist of a sequence of nucleotides connected by phosphodiesterase bonds. Nucleotides only differ by the bases involved, them being adenine, cytosine, guanine and uracil. The sequence of bases is called the _primary structure_ of the molecule and is typically denoted as a word over the alphabet \(\{\mathcal{A};\mathcal{C};\mathcal{G};\mathcal{U}\}\). Additionally pairs of the bases can form hydrogen bonds (Typically adenine pairs with uracil and guanine pairs with cytosine. Other pairs are less stable and hence less common), thus folding the molecule to a complex three-dimensional layout called the _tertiary structure_. As determining the tertiary structure is computationally complex, it has proven convenient to first search for the _secondary structure_, for which only a subset of the hydrogen bonds is considered, so that the molecule can be modeled as a planar graph. Additionally so-called pseudoknots are eliminated, that is, there is no subsequence \"first base of (hydrogen) bond 1 _:_: first base of (hydrogen) bond 2 _:_:_: second base of bond 1 _:_:_: second base of bond 2\" when traversing along the primary structure. See Figure 1 for an example of a secondary structure. When abstracting from the primary structure, secondary structures are often denoted as words over the alphabet \(\Sigma=\{(\cdot|\cdot)\}\), where a corresponding pair of parentheses represents a pair of  
given primary structure uniquely correspond to the possible secondary structures. The probabilities of this grammar are then trained either from molecules with known secondary structures or by expectation maximization ([3]). After this training the probabilities on the derivation trees as induced by the trained probabilities will model the probability of the corresponding secondary structures, assuming the training data was representative and the grammar is actually capable of modeling this distribution. Thus the most probable secondary structure (derivation tree) is computed as prediction ([3]). Many other approaches as well as extensions and modifications of the ones mentioned above have been suggested over the years. A recent overview can be found in [4]. With the exception of approaches that simulate the actual physical folding process (e.g., [5]) none of the existing prediction algorithms takes into account that _in vivo_ the molecules grow sequentially and the folding takes place during their development. However it has been shown that this _co-transcriptional folding_ has an effect on the resulting secondary structures (e.g., [6, 7]). Since the simulation algorithms have the downside of being computationally expensive, it is desirable to add the effects of co-transcriptional folding into the traditional algorithms. In this paper we present an idea how this can be achieved for the SCFG approach. Due to co-transcriptional folding one would expect that the probability of two bases being paired depends on how far the bases are apart, and the probability of a part of the molecule forming a specific motif depends on how large the part of the molecule is. In SCFGs the distance between two paired bases (resp. the size of a motif) is just the size of the subword that results from the rule application introducing the base pair as first and last symbol (resp. starting building of the motif), assuming such a rule application exists. Thus to model this variability in the probabilities we suggest the concept of length-dependent SCFGs, which extend SCFGs such that rule probabilities now additionally depend on the size of the subword resulting from the rule application. We will present this extension formally in Section 2. In Sections 3 and 4 we show that existing training algorithms can easily be adapted to the new model without significant losses in performance. We have compared the prediction quality of the modified model with the conventional one for different grammars and sets of RNA.