Can you give us a pattern link or pattern name?
The idea is to work in your rib pattern, k1p1, k2p2, or whatever the pattern calls for. On the row you quoted, work 2sts in the rib pattern and then k2tog or p2tog depending on what the next sts are.
After that you have a repeat section where you work 5sts in rib and then work 2sts together, either as k2tog or p2tog depending on the sts. Finally you end with working 2sts in the rib pattern.
The idea is to maintain the rib pattern as much as possible even though you're decreasing stitches.