If you learn from them, you may improve at chess
Does playing against a higher rated opponent help you improve in chess?

My current otb rating is 1700. If i play with, let's say, a FM, will I improve more quickly than if i constantly play with 1500?
What's a good rating difference for playing a higher rated chess playing. Obviously, if I'm 1000 and I lose to a 2500, I probably have no idea what happened, and I won't learn much from that game.
Thank you for your advice in advance!
As a 1700 rated player, how often do you learn something new against a 1500 rated player and do you play your highest quality chess against opponents that you are better than?
I'd suggest targeting opponents that are at your level or 300-400 points higher rated than you. At the club level, that is still good enough to have a shot at winning at best and the opportunity to gain insight in what you need to work on at worst.
You are a strong enough of a player where it is impossible to not learn a lesson from a loss against a higher rated player. If you walk away from a game telling yourself that I didn't learn anything, your game review was superficial.

well, if my online rating is 2100 and i play with a titled player (Cm or fm), would that help?
YES

Not necessarily, masters will play unrated against you, so you would not get the full experience of playing with a higher rated opponent. Moreover, master would not necessarily want to play with lower rated opponents, since it does not help them whatsoever unless the skill level is relatively the same.

If you really learn very hard and analyze the game, then I would say yes, maybe you can learn something from your games

Even if you play unrated, the chances of getting a fm or a cm is near impossible. Let's say you do face a fm or a cm, they will most likely abort and play another game

let me put it this way. In the U.S , open tournaments sometimes, charge an extra significant fee if you are someone below a certain rating (usually determined by what the next highest section is)and register for that section. For example,in the last open i played, entry was already like 200 and the extra fee was like 500. This is done to heavily discourage underrated players to play in that section as masters absolutely loathe risking rating point on people that can barely give them any if they win.
They were kids from 1600-2000 all over the open section. All very young and very talented, they will almost all be masters in a couple of years. All those parents payed 700 for their confident kids to their butts kicked by experts and masters. These kids are amazing at improving given how well and fast they gotten to their respective ratings.
This should answer your question.
My current otb rating is 1700. If i play with, let's say, a FM, will I improve more quickly than if i constantly play with 1500?
What's a good rating difference for playing a higher rated chess playing. Obviously, if I'm 1000 and I lose to a 2500, I probably have no idea what happened, and I won't learn much from that game.
Thank you for your advice in advance!